Use MVC Widgets in your Sitefinity WebForms Templates

May 16, 2014
First off thanks to Ivan for pointing me in the right direction

It's actually really simple...there's a webforms control that's like a placeholder, tell it the controller you want to render and boom, she's there.

Here's an example

<%@ Register Namespace="Telerik.Sitefinity.Mvc.Proxy" Assembly="Telerik.Sitefinity" TagPrefix="sf" %>
 
 <sf:MvcControllerProxy runat="server" ControllerName="SitefinityWebApp.Mvc.Controllers.MainMenu.MainMenuController" ContentTypeName="SitefinityWebApp.Mvc.Controllers.MainMenu.MainMenuController" />

If you need to add properties

<sf:MvcControllerProxy ID="MvcControllerProxy1" runat="server" ControllerName="SitefinityWebApp.Mvc.Controllers.MyWidget1Controller"
                  ContentTypeName="SitefinityWebApp.Mvc.Controllers.MyWidget1Controller"
                  SerializedSettings='{ Message: "This is a test" }'>
</sf:MvcControllerProxy>

...awesome



Other Resources

  1. http://www.sitefinity.com/blogs/slavo-ingilizovs-blog/2013/10/21/new-mvc-goodness-in-sitefinity-6.2
  2. http://www.sitefinity.com/blogs/stefani-tacheva-s-blog/2014/03/11/how-to-check-whether-url-parameters-are-resolved-in-pages-with-mvc-widgets




Image Description

Steve McNiven-Scott

Best\Only Blogger on this site. Therefore defacto blogger of the year Award Winner.