Dear all,
I am working on my first EPiServer project and really appreciate what I'm discovering day after day. :)
However, we have the need to migrate an existing .NET MVC website into EPiServer. So what we have done is integrate the EPiServers references into the existing classic MVC solution, which has worked like a charm. So we have now the main part of the website that is classic .NET MVC and we have define an area in the file structure specific to EPiServers, where we manage all the blocks definitions, the pages definitions, etc... As you can see below :
Image may be NSFW.
Clik here to view.
In this mixed solution, I can access the EPiServer's backend and create some content that I'm then able to access through the front-end of my website. We have already create a set of blocks that we are able to add on pages and have them working in front-end part. But now we need to start to add some dynamic behaviour like pagination into our blocks, so we need to integrate some logic for blocks, which should be done at the controller level of the block.
The problem is that my blocks controllers are never hitting, I can place some breakpoints into them, those one are never hitted. I guess this is because of this Area structure of my solution. For pages, EPiServer hits the controller, no worries, but not for blocks. But my page types are defined in the same way as my block types, so why is it working for pages and not for blocks?
Just one thing more, in order to have EPiServer front-end pages working in my mixed solution, I had to register the following area :
public class CmsAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Cms";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute("Cms_default","Cms/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
}
Then as I have said, pages controllers are working fine and I can display some EPiServer's content. Can you help me find the right way? Do I have to implement a custom blocks engine something like this?
Thanks in advance for your help, cheers,