在我的全局asax文件中,我想映射一个这样的路由:
http://domain.com/add/link?url=http%3A%2F%2Fgoogle.com
然后使用我的LinkController和名为Add的操作捕获它.
我这样做吗?
global.asax->
routes.MapRoute( "AddLink","Add/Link?{url}",new { controller = "Link",action = "Add" } );
LinkController->
public string Add(string url) { return url; // just want to output it to the webpage for testing }
??这似乎不起作用.我究竟做错了什么?谢谢!
解决方法
原文地址:https://www.jb51.cc/aspnet/247963.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。