Question

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"/>
Was it helpful?

Solution

<asp:LinkButton ID="Btn_RemoveContractPeriod" Text="Remove" runat="server" OnClientClick="return confirm('Message')"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top