无法使用asp.net 4 webforms routing获取System.Web.SessionState

在WebForms中使用system.web.routing但是找不到合适的解决方案时,我在这里看到了几个问题,例如State Service。 我在iis7上使用带有webforms的asp.net路由。我在下面添加了webconfig文件,让它在第一宫工作
       <system.webServer><modules>
        <remove name="UrlRoutingModule-4.0" />
        <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />   
 </modules>
     </system.webServer>
问题是,当我使用路由页面会话状态不可用,我得到
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
我启用了sesison状态,如果我用aspx扩展而不是路由url调用页面本身一切正常。 任何人都知道如何通过路由获得会话状态?     
已邀请:
得到它了!见http://www.heartysoft.com/post/2010/07/26/aspnet-routing-iis7-remember-modules.aspx
<system.webServer> 
<modules > 
<remove name="UrlRoutingModule-4.0" /> 
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> 
<remove name="Session"/> 
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition=""/> 
      

要回复问题请先登录注册