Adding Widget to cshtml page

Topics: Controls, Themes
Apr 12, 2012 at 9:36 AM

I would like to add a widget to my theme at a speocific place in my page. this was pretty easy in web form but my theme is using cshtml (MVC), how can I add the widget to my page?

do I need to create a new method like RenderControl but only for widgets?

Apr 12, 2012 at 2:13 PM

Take a look at Garland-Revisited theme included with BlogEngine. It is Razor (cshtml) theme that works with any existing widget without modifications, you don't have to do anything extra. If you want to create widget using Razor syntax, you can check using Razor HTML helper example.

Apr 13, 2012 at 7:42 AM

I am working with this theme, and I saw that the widgets there are a part of a "Widget Zone". do I have to put a widget zone to surround my widgets? even if I need only one or two in specific places?

Apr 13, 2012 at 2:02 PM

Yes, zone required to be able to add/remove widgets. You can have multiple zones if you need add widgets in different places.

Apr 15, 2012 at 6:37 AM

with that question answered, is there a way to render a simple control to the page? I'have tried to use the RenderControl method on the cshtml page but with no luck. 

is there any other method that I can use?