Essentially the same process takes place but with an MVC bent.

You have a controller that determines the type of data being requested,
retrieves it and sends it to the appropriate view/master pair.

public void Show(string pageId)
{
  var data = CmsRepo.GetDataForPage(pageId);
  var viewName = ViewManager.GetViewNameForPage(pageId);
  var masterName = ViewManager.GetMasterForPage(pageId);
  return View(data, viewName, masterName);
}

You can probably get clever with routing, view location, custom controller
base classes, etc but I'd start with a more explicit approach and eliminate
pain points as they come up.

Michael M. Minutillo
Indiscriminate Information Sponge
http://codermike.com


On Tue, Sep 6, 2011 at 1:11 PM, Craig van Nieuwkerk <[email protected]>wrote:

> Have a look at http://orchardproject.net/
>
> It is an open source CMS written in MVC. The code is fairly easy to follow.
>
> Craig
>
>
> On Tue, Sep 6, 2011 at 3:04 PM, Michael Ridland <[email protected]> wrote:
>
>> Hi
>>
>> I'm struggling(well I have done for a long time) to get my head around how
>> you would write a CMS in Asp.net MVC.
>>
>> It's really easy to understand how you do this in webforms, this is how I
>> understand it and how I've done it before.
>> 1. A CMS page is requested, I look up the information for a page
>> 2. Locate the custom master page and set it
>> 3. I iterate through the page details and then add the appropriate
>> controls to the appropriate section on the master page
>>
>> I just don't understand how I would do this in ASP.NET MVC.
>>
>> How would/have you done this sort of solution in ASP.NET MVC?
>>
>> *Michael Ridland | ThinkSmart Digital*
>> Managing Director
>> P. 0404 865 350
>> E. [email protected]
>> W. www.thinksmartdigital.com.au
>> T. www.twitter.com/rid00z
>> L. au.linkedin.com/in/michaelridland
>>
>>
>>  <http://au.linkedin.com/in/michaelridland>
>>
>>
>

Reply via email to