views:

93

answers:

1

I want to inject a confirmation dialog to allow the user to cancel the click before the postback occurs.

What's the cleanest way?

<asp:LinkButton ID="Btn_RemoveContractPeriod" Text="Remove" 
runat="server" OnClick="OnRemoveContractPeriod_Click"/>
+2  A: 
<asp:LinkButton ID="Btn_RemoveContractPeriod" Text="Remove" runat="server" OnClientClick="return confirm('Message')"/>
Mehdi Golchin
but how then do i hook it up so after confirmation postbacks and calls the server code?
Dustin Getz
If confirm function returns false, the __doPostback wont be called. otherwise, click event will raise.
Mehdi Golchin