ASP.NET MVC Url Route supporting (dot)

后端 未结 5 1681
野性不改
野性不改 2020-11-27 03:34

I hope that you can help me with the below problem.

I am using ASP.NET MVC 3 on IIS7 and would like my application to support username\'s with dots.

Example:

5条回答
  •  余生分开走
    2020-11-27 04:36

    Just add this section to Web.config, and all requests to the route/{*pathInfo} will be handled by the specified handler, even when there are dots in pathInfo. (taken from ServiceStack MVC Host Web.config example and this answer https://stackoverflow.com/a/12151501/801189)

    This should work for both IIS 6 & 7. You could assign specific handlers to different paths after the 'route' by modifying path="*" in 'add' elements

      
        
          
            
          
        
        
        
          
          
          
            
          
        
      
    

提交回复
热议问题