ASP.NET MVC2 中的URL传值问题
人海迷航 2011-08-14 03:47:09 一个URL,例如 /Product/Del/10
其中,Product 是 controller
Del 是 action
10 是 action 的唯一参数
对应的action是这样写的:
[HttpGet]
public ActionResult Del(int? productid){
// do something here.
}
上面的 HTTPGet 加不加都无法获取到 productid 的值,也就是 10
URL 改成下面这种模式就能接受到
/Product/Del/?productid=10
请高手指点一下怎么解决?