Search code examples
asp.netasp.net-mvcsitecorerenderingsublayout

Display Sitecore MVC rendering inside a Sitecore sublayout (Webforms page)


I've converted a sublayout to a MVC rendering and it needs to be statically bound to another sublayout. The old sublayout was bound using

<sc:Sublayout runat="server" ID="myID" Path="file/path/tothe.ascx" />

Now that the component is a rendering i've tried

<sc:Rendering runat="server" ID ="renderingID" Path="file/Path/ToView.cshtml"/>

and

<sc:Rendering runat="server" ID="renderingID2" renderingname="ReturnToSearchLink"/>

Neither have been succesful. Just nothing shows up and the rendering doesn't get hit while debugging. Any suggestions would be much appreciated


Solution

  • Out of the Box each page should be either WebForms or MVC.

    Not advisable but if you really want there are solutions. Like the Hedgehog MVC aspx interop. I never tried statically bound, but you can give it a try.

    See http://www.hhogdev.com/blog/2012/december/mvc-webforms.aspx

    See Does anybody have experience in maintaining Sitecore MVC and Web Forms in a single solution?