Try our conversational search powered by Generative AI!

Dynamic Content Inside some other pages.



I have a dynamic content as Banner inside a BannerGroup, If we render BannerGroup Page then all the Banners which is inside the Bannergroup page should be renderd, here all the banners are working properly except Banner which is having Dynamic Content it Only Shows  " {DynamicContent:MiniCEP}" The dynamic Control Is not being loaded from the bannerGroup page.

Please Help..


Sep 19, 2011 9:43

You must use the <EPiServer:Property .. > control for DynamicContent to render properly, calling <%= CurrentPage.Property["DynamicContentProperty"] %> will not work.


Sep 19, 2011 10:03


I am using the same and its working properly if we are accessing directly the page where we have inserted the "Dynamic Content".My problem is a bit diferent, I have "DynamicContent" inside a page called"Banner", this banner is present under a page called Banner group which contains no of banners.Whenever a user tries to acees bannergroup all the banners inside the page BannerGroup sjould be rendered. Here all are working properly Except Banner which have dynamic content inside.

I am using the following code to show all the banners inside the BannerGroup page

 ArrayList arrBanners;
protected Repeater rptBannerGroup;
string strBannerContent = PropertyTool.Instance.getStringProperty(banner, "BannerContent");
rptBannerGroup.DataSource = arrBanners;


Sep 19, 2011 12:39

Without knowing anything about the "PropertyTool" you are using, it seems to me as if the bannercontent
is retrieved as a string from the property named "BannerContent":

string strBannerContent = PropertyTool.Instance.getStringProperty(banner, "BannerContent");

If thats the case, then DynamicContent wont render correctlym you'll need to add the content through the EPiServer:Property control.


Sep 19, 2011 13:02


Can i use Episerver:Property control in Code behind ie:using C#, If yes can u please help me by giving some clue how to use it...


Sep 20, 2011 11:02


You can, but in order for them to render correctly, you'd have to add the propertycontrols to the controlcollection and then
call RenderControl() on it:

Control propertyControl = new EPiServer.Web.WebControls.Property();
propertyControl.PageLink = banner.PageLink;
propertyControl.PropertyName = "BannerContent";

Controls.Add( propertyControl );

But, as it seems as if the resulting banners are to be used in a webcontrol thats databound anyway, cant you just put the Propety-control in the markuptemplate for the rptBannerGroup-control ?


Sep 20, 2011 11:23

Hi ,

I have renderd it properly, the Ui looks as it should be,Bt now am facing different problem.Button click events is not working properly as it has aquired different ID.


Sep 20, 2011 15:17


Is the button created by the DynamicContent-plugin?
If so, try assign an ID to the Property-control you create.


Sep 21, 2011 9:40


I am using following code to render Dynamic content,

PropertyLongStringControl ctrl = new PropertyLongStringControl();
ctrl.ID = "DynamicContentBanner";
ctrl.PageLink = banner.PageLink;
ctrl.PropertyData = banner.Property["BannerContent"];
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
var page = new FormlessPage();
HttpContext.Current.Server.Execute(page, htw, false);

 Here "RenderControl(htw)" throws exception the ""ctl01_hiddenTripType' of type 'HiddenField' must be placed inside a form tag with runat=server""

so i am using "HttpContext.Current.Server.Execute(page, htw, false);" bt in this case button click event which is created in Dynamic Content control is not being fired..

is it possible to use dynamic content in this way???

please help


Sep 21, 2011 15:09


If you are executing your code in context of some page event, then it would be simpler to just add the propertycontrol to
"your" page, then call Control.RenderControl( htw ), and then afterwards remove it from the controlcollection.




Sep 22, 2011 10:10

The easy way is to Make a list of all the banner pages and bind it to this repeater

<asp:Repeater runat="server">


<EPiServer:Property runat="server" PropertyName="BannerContent" />



Sep 22, 2011 13:33


You can get all your banners like this:

var banners=EPiServer.DataFactory.Instance.GetChildre(new PageReference(your id with banners));

then you can filter out those the user is not allowed to see and that is published like this

var access = new FilterAccess();
access.RequiredAccess = AccessLevel.Read;

var published = new FilterPublished();


then you can bind it to your repeater



<asp:Repeater runat="server" id="List">
    <EPiServer:Property runat="server" PropertyName="BannerContent" />

Sep 23, 2011 12:11
* 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.