18 Jul 2012
18 Dec 2009
Link to this post
I'm not sure if this is a bug or if I'm just doing this wrong...
I have a usercontrol which shows an item details based on the id specified in a query string.
if the query string is not passed, or if the item does not exist, I want to override the control to throw a 404 error, because the page should technically not exist (since there is no such item). However, when I do this, the sf404 handler takes my page and tries to find it by appending .aspx to it. Since the page DOES exist, and it already HAS the .aspx extension, this seems like incorrect behavior.
here's more details:
the page is items.aspx, but you have to access it with something like items.aspx?id=99
if the item is found, no problem.
however if the item number doesn't exist, or if you just access via items.aspx, I want to return status code 404, because that page should not exist.
If I access the page items.aspx, I get redirected through the 404 handler, BUT when I'm debugging at look at the url being accessed, it now shows items.aspx.aspx which is not found.
even stranger, this doesn't seem limited to my custom page. If I go to any non-existant page, it's redirecting me to 404.aspx.aspx
i fixed this by changing the error in web.config to redirect to "404" instead of "404.aspx" but somehow I feel like I must be doing something completely wrong...