Try our conversational search powered by Generative AI!

Creating Vanilla MVC pages in an EPiServer MVC project


I sometimes create a one off page to do data migration or other one off tasks. Before this has been a standard aspx webform which works fine - working outside of the CMS completely.

I'm creating an MVC project but i can't seem to do the same thing. If I create a simple (non EPiServer) view or controller I can't navigate to it. Example - controller MigrationController, action method Index(). The url {root}/Migration/Index doesn't work.

It's not a huge issue - just an oddity really. Is it possible to get these one off pages working with MVC or is it wise just to use web forms for this still. Does the EPiServer routing completely override the standard MVC routing thus making this impossible.

Just wondering really

Nov 04, 2013 13:12

How does your RouteConfig look? Try adding:

                new { controller = "Home", action = "Index", id = UrlParameter.Optional }



Nov 04, 2013 14:03

Be aware that register the routes as Frederik suggest also opens up for requests like http://yoursite/StandardPage/ (given that you have a controller StandardPageController). The request will likely fail since there is no content routed to but it will give a 500 response rather than a 404.

To avoid that you can register a less generic route like:

     new { controller = "Migration", action = "Index", id = UrlParameter.Optional }

Nov 04, 2013 14:28

Interesting, good tip Johan!


Nov 04, 2013 16:41
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.