Url相关

1. Url参数

//ex1
Url是http://localhost:52417/Table1/12/22

Table1是Table1.cshtml
UrlData[0]是12
UrlData[1]是22

//ex2
Url是http://localhost:52417/Table1?a=12
Table1是Table1.cshtml
Request["a"]是12

注意:ex1与ex2可以混合使用

2. 其他

Url是http://localhost:52417/Table1/22/22?a=a1&c=c1
HttpContext.Current.Request.QueryString //返回 a=a1&c=c1
HttpContext.Current.Request.Url //返回 http://localhost:52417/Table1/22/22?a=a1&c=c1

 

posted @ 2017-02-02 10:39  BB9487  阅读(111)  评论(0)    收藏  举报