how to identify Clicked buttons
Hai,
Iam doing online booking project in ASP.Net by using C#.Net.I have a problem.That is
There are 50 buttons and a submit button.When we click submit Button.we have to find which buttons are clicked in That 50 buttons and change the back color of that buttons.
I have tried putting them in an arraylist but iam didn't get.So any body give an idea.
nikshuklaPosted Nov 6, 2006, 10:54 AM
Private Function DidControlCausePostBack(ByVal uniqueID As String) As Boolean
Dim bool As Boolean = False
bool = (Not Request.Form(uniqueID) Is Nothing) OrElse (Not Request.Form("__EVENTTARGET") Is Nothing AndAlso Request.Form("__EVENTTARGET").Equals(uniqueID)) OrElse ((Not Request.Form(uniqueID & ".x") Is Nothing) AndAlso (Not Request.Form(uniqueID & ".y") Is Nothing))
Return bool
End Function
This will return true/fase depending on the check. Hope this helps.
Note: code is in vb.net.
md ibrahimPosted Oct 10, 2006, 7:42 AM
I guess it can be done in the following way
1> Write a common function btnCommon_Click and add to the event handler when any button is clicked.
2>This function will keep a list of all the buttons which all are clicked
3>Finally when you do a submit take care of all the clicked buttons.
I hope it will solve the purposs
regards,
Ibrahim
md ibrahimPosted Oct 10, 2006, 7:42 AM
I guess it can be done in the following way
1> Write a common function btnCommon_Click and add to the event handler when any button is clicked.
2>This function will keep a list of all the buttons which all are clicked
3>Finally when you do a submit take care of all the clicked buttons.
I hope it will solve the purposs
regards,
Ibrahim