London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Render pages in ContentArea (Webforms)

Vote:
0

Hi!

I've seen a lot of guides on how to render pages in ContentAreas in MVC but I can't find any guides on how to do that in Webforms. Is there an easy way to do that?

#88507
Jul 15, 2014 13:55
Vote:
0

Hi,

Have you installed the Visual Studio Tools? There are templates for partial controls.

Basically you create a new user control and inherit from ContentControlBase. Then you can decorate the user control with the TemplateDescriptor attribute, e.g.:

[TemplateDescriptor(
    Inherited = true, 
    AvailableWithoutTag = true)]
public partial class NewsArticleTeaser : ContentControlBase
{
}
#88515
Jul 15, 2014 16:53
Vote:
1

Thank you! Exactly what I was looking for :)

#88535
Jul 16, 2014 11:56
Vote:
0
If you use [TemplateDescriptor()] as mentioned above you can also control where the pages are allowed to be rendered as well by using Tags = string []  {"YourTagName"} 
Then you use RenderSettings on your episerver:property-webcontrol to set the tag name as well
#88536
Jul 16, 2014 12:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.