asp.net mvc - httpErrors ExecuteUrl not redirecting -
i have asp.net hybrid web forms/mvc application. i'm attempting use httperrors tag in web.config redirect custom error page when user attempts upload file exceeds maxallowedcontentlength.
while "redirect" responsemode works fine, cannot "executeurl" responsemode work.
this problem occurs both when unit testing in visual studio 2013 using iis express, , when deployed machine running iis 7.5.
using "redirect" full path mvc controller works fine:
<httperrors errormode="custom" existingresponse="replace"> <remove statuscode="404" substatuscode="13" /> <error statuscode="404" substatuscode="13" prefixlanguagefilepath="" path="http://localhost:12345/error/errorfileuploadsizeexceeded" responsemode="redirect" /> </httperrors>
however, using "executeurl" relative path not work (instead see default iis 404 page, iis cannot find relative path):
<httperrors errormode="custom" existingresponse="replace"> <remove statuscode="404" substatuscode="13" /> <error statuscode="404" substatuscode="13" prefixlanguagefilepath="" path="/error/errorfileuploadsizeexceeded" responsemode="executeurl" /> </httperrors>
what need change "executeurl" work?
please check if mvc controller located in same application pool application itself.
for architectural reasons, iis 7.0 can execute url if located in same application pool. use redirect feature execute custom error in different application pool.
Comments
Post a Comment