eri*_*len 5 asp.net-mvc controller query-string
我知道如果我有一个像XController/Action?id = 1的url,还有一个action方法
void Action(int id)
Run Code Online (Sandbox Code Playgroud)
将自动从查询字符串中读取id参数.
但是,当我事先没有知道所有参数的名称时,如何访问整个查询字符串.例如:
void Action(QueryStringCollection coll) {
object id = coll["id"];
}
Run Code Online (Sandbox Code Playgroud)
可以这样做吗?
| 归档时间: |
|
| 查看次数: |
12977 次 |
| 最近记录: |