Javascript return value

  • Thread starter Thread starter Srinivasan
  • Start date Start date
S

Srinivasan

I want to include javascript confirm inside the Button_Click even procedure and contine the process based on the user selection. The real problem is how to assign javascript confirm return value to the private variable declared inside Button_Click event. Please any one help me.
 
You can't do this with a private variable, but you can with a Protected
variable. Here's a simple example of embedded use within a javascript block
in the .aspx page, referencing a variable in the code-behind:
..
..
..
<%If sPopupedWindow <> "" Then%>
newwindow=window.open("<%=sPopupedWindow%>");
<%End If%>

</SCRIPT>

references:

Protected sPopupedWindow As String

Srinivasan said:
I want to include javascript confirm inside the Button_Click even
procedure and contine the process based on the user selection. The real
problem is how to assign javascript confirm return value to the private
variable declared inside Button_Click event. Please any one help me.engine supports Post Alerts, Ratings, and Searching.
 
you can use a Hidden Input Server Control named "hdConfirm"
if(window.confirm("delete?"))
hdConfirm.text ="yes";
else
hdConfirm.text = "no";

when your page is posted back ,you can get the value the hdConfirm Hidden
Control,if yes, do some .....

Srinivasan said:
I want to include javascript confirm inside the Button_Click even
procedure and contine the process based on the user selection. The real
problem is how to assign javascript confirm return value to the private
variable declared inside Button_Click event. Please any one help me.engine supports Post Alerts, Ratings, and Searching.
 
Back
Top