Skip to content

Question about Response.Write/Redirect

zeze box

Asked Aug 21, 2010, 9:46 PM EDT1 answer
Share
LinkedInX
how can i use these two commands together when i try it it works but the redirect activates before i can see my write. for example when i click my update button inside the code i would put all the stuff i want to send to a database, but if an error occurs i want to reply with a message then redirect after the user clicks ok on that pop-up. anyways heres the code im using for the .write .redirect:

Response.Write("<script>alert('Update Unsuccessful');</script>");
Response.Redirect("Page.aspx");

ill have this in an if statement checking for problems if something comes up i want the user to know what they did wrong then it redirects them to the same page.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    Response.Write("<script>alert('Update Unsuccessful'); window.opener.document.location.href='Page.aspx';</script>")
    0