一个URL,例如 /Product/Del/10
其中,Product 是 controller
Del 是 action
10 是 action 的唯一参数对应的action是这样写的:[HttpGet]
public ActionResult Del(int? productid){
// do something here.
}上面的 HTTPGet 加不加都无法获取到 productid 的值,也就是 10URL 改成下面这种模式就能接受到/Product/Del/?productid=10请高手指点一下怎么解决?
其中,Product 是 controller
Del 是 action
10 是 action 的唯一参数对应的action是这样写的:[HttpGet]
public ActionResult Del(int? productid){
// do something here.
}上面的 HTTPGet 加不加都无法获取到 productid 的值,也就是 10URL 改成下面这种模式就能接受到/Product/Del/?productid=10请高手指点一下怎么解决?
解决方案 »
- 如何导入excel数据到文本框里,我的错在哪里
- 微薄上传图片后点击放大缩小的功能
- 跪求经验 关于动态公司信息用xml还是用数据库
- aspx是如何编译成C#的?
- excel宏如何录制
- 在dataset中添加了记录,用adapter却添加不到数据库中
- 新手求助~~
- 请问怎么拷贝 http://192.168.0.24/Eee/zip/a.zip 到 this.MapPath("")
- dropdownlist下拉数据,能象TREE一样么?
- HTML控件如何与run at server的控件通讯? (100分)
- 为什么把iframe的页面放在div里不能100%显示
- 点击gridview中的编辑jquery无刷新弹出层?
routes.MapRoute(
"Index", // Index主页
"{controller}/{action}/{name}/{typeid}", // 带有参数的 URL
new { controller = "Home", action = "Index", name = "", typeid = "" } // 参数默认值
); routes.MapRoute(
"GetOrder", // 根据采购订单单号获取产品信息
"{controller}/{action}/{_order}",// 带有参数的 URL
new { controller = "Purchase", action = "FindProductByOrder", _order = UrlParameter.Optional } // 参数默认值
); Action
public void FindProductByOrder(string _order)
{
// HttpContext.cy Response.Write(1);
}