asp.net 4 routing not working in iis 7

帅比萌擦擦* 提交于 2019-12-02 22:47:45

i got the solution for this ... add the below code in ur web.config .. and dont forget to add runAllManagedModulesForAllRequests="true" in your module..

   <system.webServer> 
        <modules runAllManagedModulesForAllRequests="true"> 
          <remove name="UrlRoutingModule"/> 
          <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
        </modules> 
        <handlers> 
          <add 
            name="UrlRoutingHandler" 
            preCondition="integratedMode" 
            verb="*" path="UrlRouting.axd" 
            type="System.Web.HttpForbiddenHandler, System.Web,  
              Version=2.0.0.0, Culture=neutral,  
              PublicKeyToken=b03f5f7f11d50a3a"/> 
        </handlers> 
      </system.webServer>

Note: You have to set Application Pool to Asp.net 4.0 application pool , as routing is not working with Asp.net 4.0 Classic Application pool.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!