How to redirect another page after displaying JavaScript alert message in ASP.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anupam Jana
    New Member
    • Dec 2010
    • 1

    #1

    How to redirect another page after displaying JavaScript alert message in ASP.net

    Hello All,

    I want to redirect to some other directory page after displaying JavaScript alert message in ASP.net in a page.
    For that I tried bellow code in our application ~/Profile/MyProfile.aspx. cs file

    string redirectTo = "~/Logins/Login.aspx"; //The page I wish to redirect to.
    string script = "<script>"; //Begin Script tag
    script += "alert('" + ui_lblError.Tex t + "');"; //Javascript Alert box
    script += "window.locatio n='" + redirectTo + "'</script>"; //Redirect to the page specified above.

    RegisterStartup Script("startup ", script);

    This is displaying alert message but not redirecting the login page. This also happning duto wrong file path.

    Please let me know how do I manipulate the path.

    Thanks in advance.

    Regards,
    Anupam
    Anupam_jana@yah oo.com
Working...