3

I have view names like Folder-One/Page-One.aspx I want to do a base controller implimentation that all request go to one Base Controller, that returns the view based on the context. Obviously still keeping the .aspx in the path

I have folders like getting-started/application-faq.aspx but what I want to do is I want to create 1 controller that does all the return views, as the pages are basicly static html

Is this possible?

1 Answer 1

2
routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{view}.aspx",                           // URL with parameters
            new { controller = "Base", action = "ChooseView" ,view ="Page-One"}  
        );

and your action can choose view to show :

publict ActionResult ChooseView (string viewName)

{ return View("~/Views/"+viewName); }

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.