Hi,

I have the following code to show a confirmation box, it works fine without the return false/true part.
I tried to add the return true or false part to get the result of the confirmation box, but nothing is happening.

How can I catch if the user clicked yes or no in my asp.net code?

Code:
 System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">var r=confirm(""Press a button"");" _
+ "if (r==true)  { alert(""You pressed OK!""); return true; }        else  {  return false ; alert(""You pressed Cancel!""); return false;  }</SCRIPT>")

thanks