P
PK9
Please help:
I have a DropdownList control that has a server-side onSelectedIndexChanged
event handler. Before this server-side event handler is run, I'd like a
client-side javascript confirmation box to appear for the user to select
whether or not to continue. I've tried adding an onselectedindexchanged
event handler in the Page.Load, I've tried Page.RegisterStartupScripts, but I
can't figure it out.
Here's my code:
ASPX Page:
<aspropDownList id="lstRecordsReturned" runat="server" AutoPostBack="True"
onSelectedIndexChanged="lstRecordsReturned_Click" />
So BEFORE the server-side handler method (lstRecordsReturned_Click) is
invoked, I want a javascript confirmation box to appear to the user first
allowing them to decide whether or not to proceed (i.e. return confirm('You
will lose unsaved changes, to proceed click OK, otherwise click cancel').
I can't figure out the code to implement this type of functionality.
Any help is greatly appreciated.
I have a DropdownList control that has a server-side onSelectedIndexChanged
event handler. Before this server-side event handler is run, I'd like a
client-side javascript confirmation box to appear for the user to select
whether or not to continue. I've tried adding an onselectedindexchanged
event handler in the Page.Load, I've tried Page.RegisterStartupScripts, but I
can't figure it out.
Here's my code:
ASPX Page:
<aspropDownList id="lstRecordsReturned" runat="server" AutoPostBack="True"
onSelectedIndexChanged="lstRecordsReturned_Click" />
So BEFORE the server-side handler method (lstRecordsReturned_Click) is
invoked, I want a javascript confirmation box to appear to the user first
allowing them to decide whether or not to proceed (i.e. return confirm('You
will lose unsaved changes, to proceed click OK, otherwise click cancel').
I can't figure out the code to implement this type of functionality.
Any help is greatly appreciated.