-----------------------------------------------------------
New Message on cochindotnet
-----------------------------------------------------------
From: SujayIsQ
Message 3 in Discussion
Hi Deepak, Thanks for that reply. Works too... didnt expect a working sample from an
MS guy ... lol. Just kidding! Then, maybe you can solve another problem for
me...(pure ASP.net) Trying to accomplish (2)... I have a multipart asp.net webform
page. That is, it keeps submitting to itself and every submit shows another part. Each
section is inside a seperate "panel" that gets shown or hidden depending on the
"stage"... The thing is, I have a section on this page called "Confirm"... basically,
a part that asks "Are you sure you want to....?" Rather interestingly, this has an
"OK" and "Abort" buttons. Now, depending on which part of the webform I want to
confirm, I would love the "OK" button's CLICK event to be handled by different
event-delegates. Looks simple enough on the surface, since we have the AddHandler
method to add handlers to any event of any object! So... I added / declared the
following code in my webform... Button is: <asp:Button runat="server" ID="ConfirmOK"
Text="Confirm" /> Code to add handlers is (currently): Select Case (OpText)
Case "delete"
ConfirmOK.Text = "Confirm Delete"
AddHandler ConfirmOK.Click, AddressOf Delete_Click
Response.Write("OnClick is set")
Case Else
ConfirmOK.Text = "Confirm [" & OpText & "]"
AddHandler ConfirmOK.Click, AddressOf ConfirmOKDefaultHandler_Click
End Select The two delegates are declared as follows: Sub Delete_Click(ByVal
Sender As Object, ByVal E As EventArgs)
response.Write("delete: we came here !!!")
response.End()
End Sub
Sub ConfirmOKDefaultHandler_Click(ByVal Sender As Object, ByVal E As EventArgs)
response.Write("default handler: we came here !!!")
response.End()
End Sub Problem... Normally, I would expect the messages ("delete: we came here
!!!" or "default handler: we came here !!!") to appear on the page depending on...
blah!... Right ? Well, shit happens . Absolutely nothing happens... The page reappears
as if there was no event-handler added at all. The button's Text property is set
correctly though - the Select-Case statement. And, there are no errors or exceptions
generated by the AddHandler either... So, my question is, what happens to my added
delegate ? Who ate it up ???? PS (to Deepak): Hi... noted that you joined as a
member on FlashNMind... comments ? ... Also, I have some stuff I'd like to ask
personally to you. If I email, would ya reply ? WBR, Sujay.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/cochindotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]