Breaking my head to get Url Routing in IIS 7 hosting environment : ASP.NET

后端 未结 4 1945
灰色年华
灰色年华 2021-02-06 01:02

I am trying to implement ASP.NET URL routing using the System.Web.Routing. And this seems to work fine on my localhost however when I go live I am getting an II

4条回答
  •  北海茫月
    2021-02-06 01:16

    Not sure if you were able to figure out what the problem was...however if you are still looking for a solution then you may try the following. I had to face the same situation some time back and got it to work using Rewrite rules in Web config for which you will not need any routing mechanism. So first I would encourage you to remove any routing setting you may have and the code from the Global.asax file too.

    Then in the section you can add as rewrite rules as follows

    
        
            
        
        
            
            
            
                
            
            
            
        
      
    

    If you have problems understanding the rewrite mechanism I would recommend that you read this article by Scott Guthrie.

    I think this should work for you given a IIS 7.0 or 7.5 environment.

提交回复
热议问题