I need to redirect the user to page not found page if the url doent exist. if the user copy the url and paste it on the rbowser, the page shows page not found method.
in this i need to redirect the user to page not found page
RedirectToAction is meant for doing 302 redirects within your application and gives you an easier way to work with your route table. Redirect is meant for doing 302 redirects to everything else, specifically external URLs, but you can still redirect within your application, you just have to construct the URLs yourself.
See this:
How can I properly handle 404 in ASP.NET MVC?
which refers to this:
http://blogs.microsoft.co.il/blogs/shay/archive/2009/03/06/real-world-error-hadnling-in-asp-net-mvc-rc2.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With