Rank: Member Groups: Member
Joined: 12/8/2009 Posts: 26
|
Hi There,
I am trying to add a cancel button to the footer of a dialog and I would like when the button is clicked to close the dialog as if I have pushed the ESC key. How would I do that? I currently have:
<asp:ImageButton id="AcceptButton" runat="server" CausesValidation="true" ImageUrl="~/Images/dark_blue_dlg_ok.gif"> </asp:ImageButton> <asp:ImageButton id="CancelButton" runat="server" ImageUrl="~/Images/dark_blue_dlg_cancel.gif"> </asp:ImageButton>
The ok button works fine but the cancel button causes a postback. When I push the ESC key no postback occures. I would like the cancel button to emulate that.
Thanks for your help,
Steve.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will need to set the dialog's CancelButton to the ID of your button. Otherwise it is just a standard ASP.NET Button and it will do what a standard button does. Placing the button inside the dialog alone does not change the button's behavior.
Thanks!
|