2013-02-18 37 views
1

我有一个jquery-ui标签显示来显示一些数据,我想从我有的一些操作返回时,链接到它内的特定页面。如何使用RedirectToAction做'/ controller/action/1#myid'的equivilent?

我现在有这个

return RedirectToAction("Action", "Controller", new { id = model.ID}); 

导致该

/controller/action/1 

什么是实现这一目标的最佳途径?

/controller/action/1#mytab 
+1

可能重复http://stackoverflow.com/questions/ 602788/asp-net-mvc-redirecttoaction-with-anchor) – Curt 2013-02-18 11:26:35

+0

啊,是的,我忘记了它被称为锚点,这使得寻找解决方案更快。 – Void 2013-02-18 11:38:05

回答

0

这个问题是重复的,但任何人谁在这里第一次发现自己的方式:

return Redirect(
      Url.RouteUrl(new 
      { 
       controller = "MyControllerName", 
       action = "MyActionName", 
       id = model.CustomerID 
      }) + "#mytabid"); 
[ASP.Net MVC RedirectToAction锚(的