ASP.Net MVC3 routing reserved words?

前端 未结 2 1936
Happy的楠姐
Happy的楠姐 2020-12-07 01:37

I have an ASP.Net MVC application with the standard routes defined. The app edits meta data for our database. The url scheme is:

http://localhost/tables/Ed         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 02:11

    CON is a reserved word like COM1, COM2, COM3, COM4, LPT1, LPT2, AUX, PRN, NUL.

    I also run into this problem while using ajax request. I solved by putting "-" char at the beginning of parameter, and then I replaced it in code-behind.

    But it was a silly solution, you can solve this problem easily by simply adding

        
            
             ......
        
    

    to your Web.config file and you can safely use these words in urls.

提交回复
热议问题