Guest User

Untitled

a guest
Jan 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. protected void Application_Error(object sender, EventArgs e)
  2. {
  3. HttpException httpException = Server.GetLastError() as HttpException;
  4. if (httpException.ErrorCode == 404)
  5. Response.Redirect("/MainPage.aspx");
  6. }
  7.  
  8. <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx">
  9. <error statusCode="404" redirect="MainPage.aspx" />
  10. </customErrors>
Add Comment
Please, Sign In to add comment