We need to do server side validation. This was why I didn't use js to begin with. When the validation is successful I want to display a message box. If they click OK I want them to be directed to one page. If they click cancel I want them to be redirected to an another page.
I have this working fine for the ok part. When the user clicks ok I can direct them to another. However my problem is that I'm not sure how to redirect them if they press cancel.
Can I use my first message box to return a true or false value?
At the moment I only seem to be able to return a true value with my first box. I assume this is because I have put true into the vb code. Is there a way I can look to return both true and false here? I tried something like this but it gave me an error saying there was too many arguments or something like that.
The second box that I generate on the client side can test for true and false values.
Any assistance would be appreciated.
Here's the relevant pieces of code:
'This is my server side code
var ans=window.confirm('Would you like to continue');
if (ans == "true")
window.location.href = "myPage1.aspx";
window.location.href = "myPage2.aspx";