[英]asp.net mvc 3 routing aspx page from controller
i want to route from my controller to .aspx page. 我想从我的控制器路由到.aspx页面。 i am trying this but that doesn't work.
我正在尝试这个,但这不起作用。
return Redirect("~/Views/Report/UygulamaYanitiRapor.aspx");
Below code routes but i couldn't get parameter with Request.QueryString["gelen"]. 下面的代码路由,但我无法使用Request.QueryString [“ gelen”]获取参数。 it comes null.
它为空。
return Redirect("~/Report/UygulamaYanitiRapor/0");
routes.MapPageRoute(
"Rapor",
"Report/UygulamaYanitiRapor/{gelen}",//{gelen}/{id}",
"~/Views/Report/UygulamaYanitiRapor.aspx",
true, null,
new RouteValueDictionary { { "outgoing", new MyCustomConstaint() } }
);
Check out this walkthrough on how to set up routing for Asp.Net Web Forms: http://msdn.microsoft.com/en-us/library/dd329551.aspx 查看有关如何为Asp.Net Web窗体设置路由的本演练: http : //msdn.microsoft.com/zh-cn/library/dd329551.aspx
I think the easiest way to get this working is to modify your aspx-page to check both Request.QueryString
and Page.RouteData.Values
for the same values, possibly with a preference for the QueryString values. 我认为最简单的方法是修改aspx-page以检查
Request.QueryString
和Page.RouteData.Values
是否具有相同的值,并可能会优先选择QueryString值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.