I'm trying to write some code in my Page_Load where the user can click
OK or Cancel in a message box to decide whether they want to be
redirected or not. If the user clicks OK, then they will be redirected,
if they click Cancel, then they will be sent back to the previous page.
The error that I am getting is 'newline in constant' at the part where I
am creating the sScript string.
Can anybody help with this?
Cheers,
Mike
string sPage = "";
string sScript;
switch (Convert.ToStri ng(Request.Quer yString"action" ))
{
case "AI":
sPage = activate_invisi link.aspx?seria l=" + strSerial);
break;
case "AT":
sPage = activate_target ed.aspx?serial= " + strSerial);
break;
}
sScript = "<script type=\"text/javascript\">";
sScript += "if(confirm('th is is the message for the confirm box'))
document.locati on.href='" + sPage + "';";
sScript += "else document.locati on.href='lastpa ge.aspx';";
sScript += "</script>";
Page.RegisterCl ientScriptBlock ("Redirect", sScript);
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!