ASP.NET 4.0 URL Routing HTTP Error 404.0 - Not Found

Posted by SheoNarayan under Error and Solution on 11/6/2010 | Points: 10 | Views : 9157 | Status : [Administrator] | Replies : 4

I had an ASP.NET 2.0 application, where I had used HttpHandler to write SEO friendly url. Now I had moved that app to ASP.NET 4.0 and was trying to use ASP.NET Routing. I tried simple way by creating route url in global.asax and then tried to access my routed url and I was getting following error.

ASP.NET 4.0 URL Routing HTTP Error 404.0 - Not Found


The solution of this problem is to add below config into web.config under <system.webServer>

 <system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>


Hope, this will help someone.

Regards,
Sheo Narayan
http://www.dotnetfunda.com



Responses

Posted by: Lalji_mer on: 11/11/2010 [Member] Bronze | Points: 25

Up
0
Down
Try this blog will help you,

http://blog.ysatech.com/post/2010/07/11/ASP-NET-4-URL-Routing-Default-Page.aspx

LP MER

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhuk on: 11/11/2010 [Member] Starter | Points: 25

Up
0
Down
Thanks for sharing.

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Carltoncj on: 12/29/2010 [Member] Starter | Points: 25

Up
0
Down
Thanks for the post. This is just what I was looking for.

Charles

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 12/29/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Thanks Charles!

Regards,
Sheo Narayan
http://www.dotnetfunda.com

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response