View Full Version : [CLOSED] Example Populating Panel's Content (HTML required for SEO)

May 03, 2013, 9:46 AM
At the presentation layer, it is easy to do the following:

<ext:Panel ID="P" runat="server">
<h1>Hello World!</h1>

The following will render something to the effect of:

<div id="P_Content" class="x-hidden"> <h1>Hello World!</h1></div>

... which is good because this is a pure HTML stream that a webcrawler can see.

But dynamically who do I do the equivalent?

P.html produces javascript with html as a property. That's not acceptable html stream.

new HtmlGenericControl("h1") { InnerHtml = "Hello World!" }

... produces the Html stream but not displayed by Ext.Net.

So how do you write the text to P.Content?

May 03, 2013, 10:17 AM
Hi @michaeld,

Please use ContentControls instead of Controls.

May 03, 2013, 11:13 AM
Thank you. I had actually forgotten that subtlety. Shame there's no way to cause Controls.Add to exception, as using it will break resize and flex.

May 03, 2013, 11:15 AM
Still... I would like to know how to populate ITemplate dynamically. Like, how can I dynamically fill htmlbin?

May 03, 2013, 12:59 PM
A markup HtmlBin property puts the things into a Control's Controls collection.

So, in code behind, please just populate a Controls collection.