StatusCode not working properly.
-
Me again. I have a strange problem with StatusCode. I want to simulate a '500 Internal Server Error' by setting Response.StatusCode equal to 500, but it doesn't seem to work. I've turned on trace, page renders properly, but the Status code in trace is 500. I even turned on custom errors in web.config, but Response.Status = 500 doesn't make ASP to redirect to a page inside web.config, but when I misspelled a URL, ASP redirects me to a 404 error page. Can anyone tell me how to simulate page status like that error really happened? Thank you so much!
-
Me again. I have a strange problem with StatusCode. I want to simulate a '500 Internal Server Error' by setting Response.StatusCode equal to 500, but it doesn't seem to work. I've turned on trace, page renders properly, but the Status code in trace is 500. I even turned on custom errors in web.config, but Response.Status = 500 doesn't make ASP to redirect to a page inside web.config, but when I misspelled a URL, ASP redirects me to a 404 error page. Can anyone tell me how to simulate page status like that error really happened? Thank you so much!
It's early in the morning here, so I apologise if this seems a bit muddled, but you could probably simulate this using an HttpHandler. In fact, thinking about it, this would probably be the best way to do this.
Deja View - the feeling that you've seen this post before.
-
It's early in the morning here, so I apologise if this seems a bit muddled, but you could probably simulate this using an HttpHandler. In fact, thinking about it, this would probably be the best way to do this.
Deja View - the feeling that you've seen this post before.
Thank for your reply, but could you give me any example how can I do this? I don't quite understand how can I simulate 500 internal server error with HttpHandler? On the other hand, I do use HttpHandler for captcha. Sorry for late reply. I had some issues with logging on Code Project.
-
Thank for your reply, but could you give me any example how can I do this? I don't quite understand how can I simulate 500 internal server error with HttpHandler? On the other hand, I do use HttpHandler for captcha. Sorry for late reply. I had some issues with logging on Code Project.
-
I did take a look, but this post is written today :). I was few days ago on your blog :). Anyway, thank you for your help.