This I thought would be correct and the site displays index.htm if i access it directly but when an error occurs on the site it displays the standard .NET error page -
If i set the setting to 'Off' it displays the exception trace as expected -
*it seems to be treating the ?aspexrrorpath as part of the address which then overrides the index.htm address and so displays the standard error.
I have added explicit permissions to the custom errors page for all users after reading other posts:
Thanks Ruchira, already been around the block with that one, i was testing the live site after getting .NET errors whilst testing it :-)
Stumbled across the 90% solution after reading about a patched vulnerability in .NET back in 2010 using the asperrorpath that was attached by default to .NET errors. It still dumps the page theme but at least displays the page. I think displaying the error
causes a loss of authentication context which is probably buried in the code somewhere but at least the page now displays:
The redirectMode needs to be specified because the asperrorpath part of the query was exploited in the hack and an HTTP error is always raised instead.
The 100% solution required an update the error page to an aspx page on the pilot site as well as the attribute and everything now seems to behave
Member
19 Points
89 Posts
Custom error page not being displayed
Jul 22, 2013 11:16 AM|mmacneill123|LINK
Hi folks, found a lot of posts about this but no answers :-)
I have a error redirect: <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/index.htm"/>
The URL which is being generated on an error is this..../Errors/index.htm?aspxerrorpath=/customer/order/reorder.aspx
This I thought would be correct and the site displays index.htm if i access it directly but when an error occurs on the site it displays the standard .NET error page -
If i set the setting to 'Off' it displays the exception trace as expected - *it seems to be treating the ?aspexrrorpath as part of the address which then overrides the index.htm address and so displays the standard error.
I have added explicit permissions to the custom errors page for all users after reading other posts:
Any suggestions as to why the defaultRedirect is not working?
Cheers
All-Star
52793 Points
9695 Posts
MVP
Re: Custom error page not being displayed
Jul 22, 2013 03:24 PM|Ruchira|LINK
Hello,
When you set the mode to RemoteOnly, it only works when you browser your website outside from your server. Try by setting it to On.
Please 'Mark as Answer' if this post helps you
My Tech BlogMember
19 Points
89 Posts
Re: Custom error page not being displayed
Jul 23, 2013 07:03 AM|mmacneill123|LINK
Thanks Ruchira, already been around the block with that one, i was testing the live site after getting .NET errors whilst testing it :-)
Stumbled across the 90% solution after reading about a patched vulnerability in .NET back in 2010 using the asperrorpath that was attached by default to .NET errors. It still dumps the page theme but at least displays the page. I think displaying the error causes a loss of authentication context which is probably buried in the code somewhere but at least the page now displays:
<customErrors mode="On" defaultRedirect="~/Errors/UnHandledError.aspx" redirectMode="ResponseRewrite"/>
The redirectMode needs to be specified because the asperrorpath part of the query was exploited in the hack and an HTTP error is always raised instead.
The 100% solution required an update the error page to an aspx page on the pilot site as well as the attribute and everything now seems to behave
Thanks for your response which was the only one!!
Contributor
2272 Points
586 Posts
Re: Custom error page not being displayed
Jul 23, 2013 09:26 AM|ramu.net|LINK
MAy the below link help you more.
http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/displaying-a-custom-error-page-cs
Ramu