Confirmation After Button_Click

  • Thread starter Thread starter A.M
  • Start date Start date
A

A.M

Hi,

I have a Button in and ASPX page. Because the button functionality is
critical, i have to pop-up a javascript alert function and ask user "Are you
sure ?"
What would be the best .NET way to do that ?

Thanks,
Ali
 
Add this.

strMsg = "return confirm('Are you sure?');"

imgBtn.Attributes.Add("onclick", strMsg)
 
In your code behind: button.attributes.add("onclick", "return confirm('Are
you sure');")
 
Back
Top