简体   繁体   中英

Exception in MasterPage of custom error page

I am using custom error page like ~/error.aspx, with has MasterPage file. Everything works fine when I get an exception (I get redirected to ~/error.aspx). But when I get an exception somewhere from MasterPage, I see runtime error.

Is there any way to redirect user to ~/error.aspx (thats standard) and if that doesn't work (exception on MasterPage), redirect them to some other file like ~/error.htm?

This is due to an infinite loop. when there is an error on master page, it goes to error page but error page also has the master page so it again tries to go to error page and hence creating an infinite loop. The best way to go is to make the error page purely html where no error can occur with links for redirect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM