HOY HOY - 1 year ago 113
ASP.NET (C#) Question

Confirmation box for LinkButton in Gridview before Rowcommand fires

I have a

, and a
on this gridview.

When linkbutton is clicked,
fires, however I want to ask user to comfirm the click with a comfirmation box,

  • if yes -> rowCommand fires,

  • if no-> nothing happens.

I couldn't find a way to it.

Answer Source

Add this as the LinkButton's OnClientClick property:

OnClientClick="return confirm('Do you really want?');"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download