How Can I Pass a 404 Error from Model in MVC 4 to View
In my RouteConfig.cs file I have the following to handle my Url requests;
routes.MapRoute("Product", "products/{Url}",
new { controller = "product", action = "index" });
In my model, I check that the Url entered exists in my database. However,
I want to return a 404 error that the requested page does not exist, if I
can't find a match in my database.
How can I achieve this ?
No comments:
Post a Comment