Click here to Skip to main content
16,022,752 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
Hi all,

Can anyone suggest me how to write the confirm box in code behind
and i want to get the return value whether the user clicked 'ok' or
'cancel',
Depending on that i need to process further using if else
Posted

1 solution

koushiksaha wrote:
Can anyone suggest me how to write the confirm box in code behind

Same way that your are doing using JavaScript.

But Register that function from codbehind using

ClientScript.RegisterStartupScript(this.GetType(), "Confirm",<br />"<script>Confirm('" + Are You Sure ?+ "');</script>");<br />

or if use ajax in your page then ScriptManager instate of ClientScript

 
Share this answer
 


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