Get variable from javascript
-
I have this javascript: function ConfirmationWindow() { var result = confirm("Are you sure"); } This pops up a window for confirmation. Based on a yes or no selection by the user, I will like to insert or delect some data from a database but my problem is that, how do I get the true/false value of "result" which is in javascript and use it in my C#? Any suggestion will be great Thanks alot, Commickey
-
I have this javascript: function ConfirmationWindow() { var result = confirm("Are you sure"); } This pops up a window for confirmation. Based on a yes or no selection by the user, I will like to insert or delect some data from a database but my problem is that, how do I get the true/false value of "result" which is in javascript and use it in my C#? Any suggestion will be great Thanks alot, Commickey
U can take one Hidden textbox of html and store true or false depending on the selection of Yes or No by the User. Brfore saving the record u first check the value of the hidden textbox and the save it. I hope u got what I want to say. Thanks and Regards.
-
U can take one Hidden textbox of html and store true or false depending on the selection of Yes or No by the User. Brfore saving the record u first check the value of the hidden textbox and the save it. I hope u got what I want to say. Thanks and Regards.
-
Hi, Just Drag and drop html hidden textbox on ur wen form and write the following javascript code and the changes accordingly... function CommitChanges() { document.all("<%=htxtSName.ClientID%>").value = document.all("txtShortName").value; document.all("<%=htxtLogName.ClientID%>").value = document.all("txtLogin").value; var text = "Do you want to save the changes?"; if(!confirm(text)) { document.all("<%=htxtSave.ClientID%>").value = false; return true; } else { document.all("<%=htxtSave.ClientID%>").value = true; return true; } Use this code for ur reference.htxtSave is the hidden textbox. Thanks and Regards.
-
U can take one Hidden textbox of html and store true or false depending on the selection of Yes or No by the User. Brfore saving the record u first check the value of the hidden textbox and the save it. I hope u got what I want to say. Thanks and Regards.
Another approach would be to have a button on the form that isn't displayed, which calls the update routine on the server - the check would then be something like....
res = confirm('do something?'); if (res) { document.getElementById('MyASPNETButton').click(); }
"Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox