How to enforce Http Response Code in Routing ?
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I am wondering, how I can enforce a http response code with Routing ? I am using ASP.NET Web Form 4.0. So far I understand, routes are using Http code 200 all the time. Can I override this code ever ? Or, if I place http status code response in my Page's Init or Load event, will that override that '200 ok' ? For example, I have the following route,
routes.MapPageRoute("404", "{*url}", "~/Page-Not-Found.aspx");
I want to issue Http code 404 for this routing instead of 200. Please help.