[英]how to add additional arguments to RedirectPermanent?
我想在我的return Action中添加一个viewbag消息,如下所示。...
return RedirectToAction("Index", new { Message = "Accepted Successfully" });
上面的工作正常,但是我试图在选项卡式索引视图上做同样的事情,发现以下操作后,导航到所需选项卡的唯一方法是...
return RedirectPermanent("~/ReferralTarget/Index/#users");
基本上索引是视图,而用户是索引页面上的选项卡式视图... RedirectPermanaent是否可以采用第二种方法? 谢谢..
如果必须使用RedirectPermanent
,则没有第二个参数,则可以使用String.Format
来生成url。
return RedirectPermanent(
String.Format("~/ReferralTarget/Index/#users?Message={0}", "Message here"));
但您可以使用RedirectToActionPermanent
解决您的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.