Sunday, 15 January 2012

c# - Custom Error Pages using ExecuteURL in .NET ASPX application not working (Redirects work fine) -



c# - Custom Error Pages using ExecuteURL in .NET ASPX application not working (Redirects work fine) -

this works , redirects yahoo.com desired:

<httperrors errormode="custom"> <remove statuscode="401" substatuscode="-1" /> <error statuscode="401" path="http://www.yahoo.com" responsemode="redirect" /> </httperrors>

this doesn't, , difference i'm specifying page in app rather external url:

<httperrors errormode="custom"> <remove statuscode="401" substatuscode="-1" /> <error statuscode="401" path="/errorpages/401.aspx" responsemode="executeurl" /> </httperrors>

the error on screen is:

xml parsing error: no element found location: http://localhost/app/mypage.aspx line number 1, column 1:

the status code of error (seen via firebug) 403. when browse /app/errorpages/401.aspx using browser, see error page fine.

i'm using visual studio 2012, app deployed in iis7 virtual directory through vs.

i looked @ available docs. thought i'm missing?

if you're using virtual directory need include virtual directory path in path attribute if not absolute uri.

c# asp.net error-handling webforms web-config

No comments:

Post a Comment