[CLOSED] Example Populating Panel's Content (HTML required for SEO)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Example Populating Panel's Content (HTML required for SEO)

    At the presentation layer, it is easy to do the following:

    <ext:Panel ID="P" runat="server">
    <Content>
         <h1>Hello World!</h1>
    </Content>
    </ext:Panel>
    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.

    P.Controls.Add( 
       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?
    Last edited by Daniil; May 07, 2013 at 3:55 AM. Reason: [CLOSED]
  2. #2
    Hi @michaeld,

    Please use ContentControls instead of Controls.
  3. #3
    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.
  4. #4
    Still... I would like to know how to populate ITemplate dynamically. Like, how can I dynamically fill htmlbin?
  5. #5
    A markup HtmlBin property puts the things into a Control's Controls collection.

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

Similar Threads

  1. [CLOSED] DirectEvent: passing via extraparams html content of a panel
    By tanky65 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 02, 2013, 4:25 PM
  2. Html content inside panel
    By Birgit in forum 2.x Help
    Replies: 1
    Last Post: Apr 02, 2012, 2:34 PM
  3. Add html content inside ext:panel tags
    By kirkhas in forum 1.x Help
    Replies: 15
    Last Post: Aug 03, 2011, 10:19 PM
  4. Replies: 1
    Last Post: May 28, 2010, 1:13 PM
  5. [CLOSED] panel content as html
    By alexp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 01, 2009, 6:53 AM

Posting Permissions