Last post May 10, 2018 05:45 PM by Satyaprakash Samantaray
Member
6 Points
8 Posts
May 10, 2018 05:43 PM|Sachinsboa|LINK
Is it possible to create a final route that catches all .. and bounces the user to a 404 view in ASP.NET MVC?
433 Points
31 Posts
May 10, 2018 05:44 PM|Satyaprakash Samantaray|LINK
For the global.asax, just add this code as your last route to register:
routes.MapRoute( "404-PageNotFound", "{*url}", new { controller = "StaticContent", action = "PageNotFound" } );
May 10, 2018 05:45 PM|Sachinsboa|LINK
but I don't want to set this up in my IIS settings.
May 10, 2018 05:45 PM|Satyaprakash Samantaray|LINK
yes t will work....
Member
6 Points
8 Posts
404 view in ASP.NET MVC without IIS settings
May 10, 2018 05:43 PM|Sachinsboa|LINK
Is it possible to create a final route that catches all .. and bounces the user to a 404 view in ASP.NET MVC?
Member
433 Points
31 Posts
Re: 404 view in ASP.NET MVC without IIS settings
May 10, 2018 05:44 PM|Satyaprakash Samantaray|LINK
For the global.asax, just add this code as your last route to register:
Member
6 Points
8 Posts
Re: 404 view in ASP.NET MVC without IIS settings
May 10, 2018 05:45 PM|Sachinsboa|LINK
but I don't want to set this up in my IIS settings.
Member
433 Points
31 Posts
Re: 404 view in ASP.NET MVC without IIS settings
May 10, 2018 05:45 PM|Satyaprakash Samantaray|LINK
yes t will work....