开发者

How can i route this url to right routing map?

开发者 https://www.devze.com 2023-03-13 08:37 出处:网络
localhost/myfile.xml This url is requested and i am trying to convert it to Home controller\'s Config action . My solution is at below but exception says routing can\'t include \'/\' character . How i

localhost/myfile.xml This url is requested and i am trying to convert it to Home controller's Config action . My solution is at below but exception says routing can't include '/' character . How i can do this ?

    routes.MapRoute("config",
        "/crossdomain.xml",
        new {controller="Home",action = "Confi开发者_如何学Cg" }); 


Remove the leading slash; you don't need (and cannot have) it in a route.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号