Thursday, March 31, 2011

Asp.net MVC Routing Type

i have 2 views in my App

1:Views->Season->ViewSeason

alt text

2:Views->Admin->Season->ViewSeason

alt text

How i write Controller for this? pls help me.....

From stackoverflow
  • Easiest thing to do would be to collapse Admin/Season into AdminSeason and have an AdminSeasonController.cs.

    Then update your routing table so the /Admin/Season routes to AdminSeasonController.

    This is untested, but it could look like this in your Global.ascx (above the out-of-box MVC route):

    routes.MapRoute(
                "AdminSeason",
                "Admin/Season",
                new { controller = "AdminSeason", action = "Index" }
               );
    

    Here are some other questions re: MVC Routing:

    Avinash : pls give the code for writing in global.ascx file

0 comments:

Post a Comment