|
Hi to all,
I have a problem that I want to restrict the user to select multiple checkboxes. The simple solution is using the radio button. But I still want to use the checkbox control because the client demanded that there should be checkbox for multiple selection so that user can delete multiple records.
Actually I am having a gridview. Below the gridview I have two buttons "update" and "delete".
Two records cannot be updated simuntaneously thats why I want to restrict the user from multiple selection.
Two records can be deleted simuntaneously thats why I want to go with the checkboxes.
So Is there any way to do that? Please assist me in this.
cheers,
sneha
|
|
|
|
|
Hi,
There are several solution to your problem...
You can count the no. of checkboxes that are checked on checked event using javascript if it is greater than
one then you can just show a simple message box please select only one to update.....
Please Try it out...
If any problem in this you can mail me vinod8812@gmail.com
Thank You
Vinod Kr.
Software Engineer
EBC Publishing Lucknow
|
|
|
|
|
hi,
Do u need java script function for that?
Regards
Anil Pal
|
|
|
|
|
Hi Anil Pal,
I don't want to use javascript for that.Is there any other way out.
cheers,
sneha
|
|
|
|
|
Hi,
Thats fine s now u want thats validation in code-behind right?\
If yes thenu can use foreach loop for GridView.
Now let me know if u need a code for that in c#
Regards
Anil Pal
|
|
|
|
|
Hi,
I am trying like this.Now if user selects multiple row then it will update only single row.but I want that if the user tries to select multiple rows and click on the update button then a message box should open prompting not to select multiple items and the upadation process should be cancelled.That is it should show the items before any updation.
cheers,
sneha
|
|
|
|
|
sneha Choudhary wrote: I don't want to use javascript for that.
Why?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
sneha Choudhary wrote: Actually I am having a gridview. Below the gridview I have two buttons "update" and "delete".
Two records cannot be updated simuntaneously thats why I want to restrict the user from multiple selection.
Two records can be deleted simuntaneously thats why I want to go with the checkboxes.
Then how will you know that what user want?
As per your description, you can select multiple check box and then click delete. It will delete all selected records and for update check box will work as option button.
But is there any way to identify the mode of user operation?
You can give some Dropdown list [ Similar like Yahoo inbox [ Copy | Move etc ] ] and set value as Delete | Update. When user select Delete on dropdown you just allow multiple selection and other wise allow single selection.
And what ever you do, try to all checking using JavaScript, which will decrease unnecessary server hit.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
sneha Choudhary wrote: Two records cannot be updated simuntaneously thats why I want to restrict the user from multiple selection.
If multiple records can't be updated simultaneously, what is the point in putting the update button there? Move it to a new page.
|
|
|
|
|
Hi Sneha,
Did u get solution for your problem,If not check this.
In the Code Behind by making a loop for each row in a grid, if checkbox is checked, then there itself you can update or delete that particular record with the identifier of that particular row. By this we can even update or delete more than One records of the grid.Check this once .If anything reqd,do reply me.
Regards,
Sundeep G
|
|
|
|
|
Hi,
i want to get an alert while clicking the button, so that i am using page.registerclientscriptblock()
The code looks like
private void BuildClientRecipientValidation()
{
string ValidationMessage = @"<script>
function GeneratingErrorMessage()
{
alert('Please Enter UserName');
}
</script>
";
Page.RegisterClientScriptBlock("ABC", ValidationMessage);
// throw new Exception("The method or operation is not implemented.");
}
but i am not able to get the click event.
any solution please let me know.
|
|
|
|
|
Hi,
Please clear yr problem.
1. If u simple want an alert in java script the u can call java script function on "OnClientClick" of button.
2. Now if u want alert message after doing certain functionality on code hind , means after excuation of some c# code then there is another way . The way u r trying
So please clear
Regards
Anil Pal
|
|
|
|
|
hello,
i have a problem with my asp.net application.
Description of the bug:
while i am attending to create a directory or a file in my server, i use the Filedirectory /Directory but the problem is some times while i put \\\\ it is not understanded by the framework and sometimes \\ is also not recognized.
Do something exist like a standard to avoid this kind of problem
regards
dghdfghdfghdfghdgh
|
|
|
|
|
ellllllllie wrote: some times while i put \\\\ it is not understanded by the framework and sometimes \\ is also not recognized.
what do you meant it does not recognize?
try
string folder = @"c:\my documents\special folder\projects\test1";<br />
string file = @"c:\folder name\files\file.xml";
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
i have
a remote dir.
so i have to use : \\server\directory
some time i put \\server\dir
sometimes : \\\\server\\dir
is there something commun or standard for this useage?
regards
dghdfghdfghdfghdgh
|
|
|
|
|
Hi,
if your directory is a folder that exists within your server folder,then there is a option for that.
Server.MapPath("FolderName/")
This detects the folder that your searching for.Check this Once
regards,
Sundeep G
|
|
|
|
|
Hi all,
I am new in using ajax.
I going to change pop-ups to modal pop-up using ajaxToolkit:ModalPopupExtender.
In my exisiting application i'm calling aspx page as an pop-up.
As far as I search through net, we need to write pop-up content inside <asp:panel xmlns:asp="#unknown">.
But I don't want to do that. I want to call aspx page only using ajaxToolkit:ModalPopupExtender.
Is this possible. If yes can I get example.
If not any alternative? or can I call aspx page in <asp:panel>
Please help me.
Waiting for reply.
Thanks in advance
|
|
|
|
|
You canot call another page in panel.Instead of that you can use iframe.
|
|
|
|
|
put it one iframe inside your panel..and give src your aspx page..
i think you will get that...
|
|
|
|
|
Hi,
i want to change the default values form an CreateUserWizard, ich want to change the password length and the RegExp... in asp.net 3.5
This dosent work
configuration
system.web
membership defaultprovider="AppMembershipProvider"
providers>
add name="AppMembershipProvider" applicationname="MeinApp" connectionstringname="membershipConnectionString" requiresquestionandanswer="false" requiresuniqueemail="false" minrequirednonalphanumericcharacters="0" minrequiredpasswordlength="3" type="System.Web.Security.SqlMembershipProvider"
providers
system.web
configuration
==
Warning 3 The element 'system.web' has invalid child element 'providers'. List of possible elements expected: 'anonymousIdentification, authentication, authorization, browserCaps, clientTarget, compilation, customErrors, deployment, deviceFilters, globalization, healthMonitoring, hostingEnvironment, httpCookies, httpHandlers, httpModules, httpRuntime, identity, machineKey, membership, mobileControls, pages, processModel, profile, roleManager, securityPolicy, sessionPageState, sessionState, siteMap, trace, trust, urlMappings, webControls, webParts, webServices, xhtmlConformance, caching'. C:\Dokumente und Einstellungen\Benny\Eigene Dateien\Visual Studio 2008\Projects\xxx\xxx\Web.config 35 10
THANX!!!
|
|
|
|
|
Hi,
I want to display data from db in 3 columns ;
eg:
Name:XX Name:XXXX
Age :XX Age :XX
Where Name & Age are the two fields in the db.
Plz help.
|
|
|
|
|
where you want to display elaborate your question...
Government Dyal Singh College Lahore.
|
|
|
|
|
|
Hi,
I want to display data from db in 3 columns on the asp.net webform:
|
|
|
|
|
Hi,
So where is yr problem.
R u trying to say that. U have only two columns in DB and u want to display in three column.
Please explain.
Regards
Anil Pal
|
|
|
|