简体   繁体   English

无法重定向URL

[英]Unable to redirect the URL

I have a GetCustomerDetails method in a controller, in which I am trying redirect to another page. 我在控制器中有一个GetCustomerDetails方法,在其中尝试重定向到另一个页面。 But I was unable to redirect, and it is staying in the same page from where I am trying to redirect. 但是我无法重定向,它停留在我尝试重定向的页面中。

public ActionResult GetCustomerDetails()
{
      .......
      // return Redirect("/Quote/QuoteDetails?sc_mode=preview");
      string link = "/quote/QuoteDetails";
      return Redirect(link);
      // return Redirect("../View/quote/QuoteDetails");  
      // return Redirect("~/View/quote/QuoteDetails");            
}

and I tried some of the commented options(above) but still I was unable to redirect. 并且我尝试了一些上面提到过的选项,但仍然无法重定向。

Can any body help me in this issue? 任何机构都可以帮助我解决这个问题吗?

使用RedirectToAction("Action", "Controller")方法:

return RedirectToAction("QuoteDetails", "quote");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM