Eduardo Lorenzo Posted December 18, 2006 Posted December 18, 2006 right now I use this Page.RegisterStartupScript("errorscript", "<script> alert('Account Number not Valid!');</script>") as a messagebox/warning. But what I want is to be able to display a Yes/No type alert and capture the choice for server-side processing. I know that this is possible.. I just don't know how. can anyone please help me. Quote
Jitesh Posted December 18, 2006 Posted December 18, 2006 Hello, User the javascript Confirm() messagebox. You should be able to capture the YES/NO and decide accrodingly. Some sampel from web - <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Do you really want to go to this page??"); if (where_to== true) { window.location="http://yourplace.com/yourpage.htm"; } else { window.location="http://www.barbie.com"; } } //--> </SCRIPT> HTH. Quote Jitesh Sinha
Eduardo Lorenzo Posted December 18, 2006 Author Posted December 18, 2006 Hi Jitesh and thank you very much. I have tried this option but that I want to do is to execute some ServerSide code (ASP.Net) depending on the choice. I have also tried to reference an object on the page - a hidden textbox, and it works "fine" I really want to find a way for me to catch the choice using server side code. Quote
Jitesh Posted December 19, 2006 Posted December 19, 2006 You can write the javascript code to get the page submitted back to the server and there you can do the further processing. Something like- document.FormName.submit(); Please check for the correct syntax. HTH. Quote Jitesh Sinha
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.