需要怎么设置呢,前面的URL都是通过href设置的public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Product", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );        }

解决方案 »

  1.   

    提交表单不是有 get方法吗???get方法不就是以url参数形式嘛?
      

  2.   


    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);
            }RedirectToAction后面new里面的参数值必须要跟接收ACTION的参数值保持一致。
      

  3.   

     
    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);
            }RedirectToAction后面new里面的参数值必须要跟接收ACTION的参数值保持一致。
      

  4.   

    http://localhost:5611/Order/Details/1111230941401054,用的是你的 url路由,你的路由配置参数是什么,就用什么来接收,你的路由 默认参数是id的话 就用 id
    public ActionResult Details(string id)
    你也可以 自己组装 return Redirect("/Order/Details?id=1111230941401054");
      

  5.   

    new { id = order.OrderId });
    =>
    new { orderid = order.OrderId });
      

  6.   

    public ActionResult Details(string orderid)orderid 改成id 试试看呢
      

  7.   

    接收action可以不用写方法名 , 直接用Request.QueryString("orderid")接收