Click here to Skip to main content
15,559,568 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
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
C#
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 }
           );
        }

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.
Posted

1 solution

You have to use something like below (just a sample):

C#
routes.MapPageRoute(
 "ReportRoute",
 "Report/{id}",
 "~/Areas/Accounts/Views/Invoices/Report.aspx?id={id}"
 );


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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900