I have some code that successfully traps an error 404 and diverts to an appropriate page. However, I have a problem with certain types of error. My code will trap the scenario where a user types, e.g., www.mysite.com/indecks.aspx where no such page exists. However, if the user types something along the lines www.mysite.com/index.aspx/nonsensetext where index.aspx is a valid page, the page load event for index.aspx is triggered. However the page is rendered incorrectly because, I think, it is failing to find the images and CSS file associated with the page - perhaps because it is looking at the wrong path.
I expect that I can trap this by examining, for example, Request.URL.OriginalString and, if I detect garbage, I could re-direct to the same page "more cleanly" (i.e. without the junk on the end of the URL). However I'm a bit concerned that this is happening at all. Shouldn't this be treated as a 404 error?
View Complete Post