路由在MVC 4应用程序中为aspx页面提供链接 [英] Routing In MVC 4 application for providing link for aspx pages
问题描述
在我当前的应用程序是在mvc 4中,我已经添加了一些现有的aspx。
在route.config中的
我做了类似的事情
In my current application is in mvc 4 and i have added some existing aspx in it.
in route.config i have done something like
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapPageRoute("", "Detail By Status", "~/Views/UserCallDetail/StatusDetail.aspx", true);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
问题是现在当我点击它重定向到StatusDetail.aspx页面的任何链接时我真的不知道什么是错的它可以帮助...
提前感谢。
the problem is now when i am clicking on any link it redirects to StatusDetail.aspx page what is i really haven't idea what is wrong in it ca someone help...
thanks in advance.
推荐答案
你必须使用类似下面的东西(只是一个样本):< br $>
You have to use something like below (just a sample):
routes.MapPageRoute(
"ReportRoute",
"Report/{id}",
"~/Areas/Accounts/Views/Invoices/Report.aspx?id={id}"
);
如需了解更多信息,请查看:
http:/ /stackoverflow.com/questions/5435002/how-do-i-route-a-webforms-page-in-asp-net-mvc [ ^ ]
我希望这会对你有所帮助。
For more info check this:
http://stackoverflow.com/questions/5435002/how-do-i-route-a-webforms-page-in-asp-net-mvc[^]
I hope this will help to you.
这篇关于路由在MVC 4应用程序中为aspx页面提供链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!