日期:2014-05-17 浏览次数:20435 次
public ActionResult Index(Order order, FormCollection formcollection) {return RedirectToAction("Details", "Order", new { id = order.OrderId });
$("#button_submit").click(function () { $("form[0]").submit(); });
public ActionResult Details(string orderid) { Order order = datacontext.GetOrder(orderid); return View(order); }
public ActionResult Index(Order order, FormCollection formcollection) {return RedirectToAction("Details", "Order", new { orderid = order.OrderId }); public ActionResult Details(string orderid) { Order order = datacontext.GetOrder(orderid); return View(order); }
------解决方案--------------------
public ActionResult Index(Order order, FormCollection formcollection) {return RedirectToAction("Details", "Order", new { [color=#FF0000]orderid[/color] = order.OrderId }); public ActionResult Details(string [color=#FF0000]orderid[/color]) { Order order = datacontext.GetOrder(orderid); return View(order); }
------解决方案--------------------
http://localhost:5611/Order/Details/1111230941401054,用的是你的 url路由,你的路由配置参数是什么,就用什么来接收,你的路由 默认参数是id的话 就用 id
public ActionResult Details(string id)
你也可以 自己组装 return Redirect("/Order/Details?id=1111230941401054");
------解决方案--------------------
new { id = order.OrderId });
=>
new { orderid = order.OrderId });