Link to home
Start Free TrialLog in
Avatar of Dan Violet Sagmiller (He/Him)
Dan Violet Sagmiller (He/Him)Flag for United States of America

asked on

404 redirection fails with HTML in the form submission.

I am using my 404 error page to dynamically display content.  
 - (the 404 is an ASPX page that is looking up content in the database from the original URL.)

This part has been working fine for form submission, so long as I don't include any HTML content in the form submission.

IF I include html code in a form submission, I get a generic html 404 error page.  In this circumstance, it is ignoring my error redirection.

From my Web Config:
<system.web >
   
     <pages validateRequest="false"  />
    <customErrors mode="On" redirectMode="ResponseRewrite" >
     
<error statusCode="403" redirect="dynamic.aspx" />
      <error statusCode="404" redirect="dynamic.aspx" />
Avatar of Dan Violet Sagmiller (He/Him)
Dan Violet Sagmiller (He/Him)
Flag of United States of America image

ASKER

Please note:  The form content is sent to the fake none existant page, which works, unless I posted an <hr /> or some other html tag.  (fails with a generic 404 error)
That type of error is 500, I believe.

<error statusCode="500" redirect="dynamic.aspx" />
An interesting guess, but I'm positive it is the generic 404 error, not a 500 error.  here is the content I receive back.

Server Error in '/LbpSite2' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /LbpSite2/Content Editor.aspx
Also, to clarify, I tried the 500 error at your suggestion, but it did not have any affect.  
ASKER CERTIFIED SOLUTION
Avatar of BurnieP
BurnieP
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WOW!!!  I don't understand it, but that was the cause... This was one weird error.  

apply the answer to the previous one, and I'll mark you down for it as well.  this has been huge pain.

Thanks.

I set the ErrorPage to point to itself and that worked.  
I am glad we found it! :)

I must admit I really spent time on this one, I really wanted to know the cause!

Good luck in your programming!