2012-09-04 188 views
0

我使用asp.net 3.5來建立我的應用程序, 我使用URL路由,它在我的本地主機上工作正常 在我的web.config文件中,我做了以下設置Url路由工作本地主機,但不在服務器上

<system.web> 
    <httpModules> 
     <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,     PublicKeyToken=31BF3856AD364E35"/> 
     <add name="RoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    </httpModules> 
    </system.web> 



    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules runAllManagedModulesForAllRequests="true"> 
    <remove name="UrlRoutingModule"/> 
    <add name="UrlRoutingModule" 
    type="System.Web.Routing.UrlRoutingModule, 
    System.Web.Routing, Version=3.5.0.0, 
    Culture=neutral, 
    PublicKeyToken=31BF3856AD364E35" /> 
    </modules> 


    <handlers> 
    <remove name="UrlRoutingHandler"/> 
    <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> 

但是,當我部署我的服務器上有IIS 7的應用程序和Windows 2008的R2然後路由不起作用.......我認爲我必須做一些設置IIS或改變一些web.config中的代碼。 ...

所以請有人建議我一些答案

回答

0

您是否想過從您的web-app實施Page Routing?您可能遭受

一個問題是,如果你使用AJAX(工具包或擴展),你將需要實現:

'Ignores any Resource cache references, used heavily in AJAX interactions. 
rts.Ignore("{resource}.axd/{*pathInfo}") 

爲了保持從得到Sys is undefined的錯誤,同時調試。

相關問題