Click here to Skip to main content
16,018,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to use confirmation box in asp.net using csharp.

please help me.

how can i do using csharp.

Rgds,
Narasiman P
Posted

Hi. you can use scriptmanager for this from your code behind page..

C#
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "javascript:confirm('your message...')", true);


Confirm function will return 'true' if 'OK' button is clicked and 'false' when 'Cancel' button is clicked. So perform your actions based on the button clicked....
 
Share this answer
 
v4
C#
btnDelete.Attributes.Add("onClick","return confirm('do you want to continue')");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900