onclick =“ window.location ='@ Url.Action(” Payment“,” Home“)重定向到索引页面而不是Payment

时间:2018-10-11 07:32:23

标签: asp.net-mvc

我有一个控制器,它具有索引和付款两种方法。我要在“索引”视图中单击一个按钮,但我想将其重定向到“付款”视图,但仅将其重定向到“索引”视图

   <input type="submit" value="Payment" class="btn btn-default btn-send" id="submit" name="submit"onclick="window.location='@Url.Action("Payment", "Home")'" />

public ActionResult Index()

    {
        return View();
    }

    public ActionResult About()
    {
        ViewBag.Message = "Your application description page.";

        return View();
    }

    public ActionResult Contact()
    {
        ViewBag.Message = "Your contact page.";

        return View();
    }
    public ActionResult Payment()
    {
        ViewBag.Message = "Your contact page.";

        return View();
    }

0 个答案:

没有答案