简体   繁体   中英

Sitecore 6.6 and MVC areas

I am working on a large Sitecore 6.6 MVC site. To be honest, i'm having trouble finding any good information on Google.

My question here is. I am in the Sitecore content editor on a controller rendering. I want this controller rendering to point to an MVC AREA in my MVC project.

In the data section of my controller rendering in Sitecore I have 2 text boxes: Controller and Controller Action

What do I type in the Controller text box to point to my area.

My area is this: <site root>/Areas/UserManagement/ProfileController.cs

I have tried everything. I hope someone can help.

In the Controller field you'd put Profile to specify your ProfileController and in the Controller Action field you'd enter the name of the Action of the ProfileController that you wish to invoke.

Your UserManagement area will presumably have a UserManagementAreaRegistration class where the area specific routes are defined and this will be called from the ApplicationStart event handler.

That's how to wire up controller renderings. When looking at this there are a few stumbling blocks:

  1. Action name uniqueness. I haven't managed to get the namespace overload of MapRoute to allow for action names that occur elsewhere in the solution.

    public System.Web.Routing.Route MapRoute(string name, string url, object defaults, string[] namespaces)

  2. Yet to be able to get the view resolution process to respect area paths, instead it appears to search the standard view folders determined by controller name. From your example I had to drop a copy of my razor view into ~/Views/UserManagement/ to get it to render.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM