【问题标题】:Ajax.BeginForm that can redirect to a new page and pass route value可以重定向到新页面并传递路由值的 Ajax.BeginForm
【发布时间】:2012-09-07 05:08:35
【问题描述】:

此链接显示如何重定向 @Ajax.BeginForm,但不显示如何将路由值传递给新视图。

Ajax.BeginForm that can redirect to a new page 页/9391267#9391267

您将如何重定向带有路由值的@Ajax.BeginForm?相当于

return RedirectToAction("Edit", new { id = acntId };

【问题讨论】:

    标签: asp.net-mvc-3 jquery asp.net-ajax


    【解决方案1】:

    没有什么不同,只需将Url helper overload 与路由值一起使用即可:

    return Json(new { 
        url = Url.Action("Checkout", 
            new { id = accntId }
        ) 
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-07
      • 1970-01-01
      • 2021-06-08
      • 2012-07-22
      • 1970-01-01
      • 2020-06-15
      • 1970-01-01
      相关资源
      最近更新 更多