Asp.net MVC Routing Type
-
22-08-2019 - |
Question
i have 2 views in my App
1:Views->Season->ViewSeason
alt text http://img102.imageshack.us/img102/9207/viewsseasonsx4.jpg
2:Views->Admin->Season->ViewSeason
alt text http://img242.imageshack.us/img242/1911/viewsadminsr4.jpg
How i write Controller for this? pls help me.....
Solution
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:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow