ITemplates wrapped in extra <div> tags by .net 2.0 / MCMS

Discussion in 'ASP .Net Web Controls' started by Andrew, Jun 19, 2006.

  1. Andrew

    Andrew Guest

    Hi,

    I'm trying to create a templated server control in .net 2.0 (for MCMS),
    but all control's templated items are wrapped in <div> tags (which they
    shouldn't be)

    Any idea why this is producing extra divs? Let me know if you need more
    code

    Thanks.



    I'm got the following code:

    ----- WebControl.cs -----

    ....

    [PersistenceMode(PersistenceMode.InnerProperty)]
    [TemplateContainer(typeof(Item))]
    public virtual ITemplate ItemTemplate;
    // get / set are defined here in my actual code

    public override void DataBind()
    {
    CreateChildControls();
    ChildControlsCreated = true;
    base.DataBind();
    }

    protected override void CreateChildControls()
    {
    this.Controls.Clear();
    foreach (ChannelItem channelItem in _rootChannel.Channels)
    {
    Item item = new Item(channelItem);
    ITemplate itemTemplate = ItemTemplate;
    itemCloseTemplate.InstantiateIn(item);
    Controls.Add(item);
    }
    }

    ....


    ----- with the ASPX code -----

    <ul>
    <cc1:WebControl runat="server" >
    <ItemTemplate><li><a href="<%# Container.Url %>"><%#
    Container.Title %></a></li></ItemTemplate>
    </cc1:WebControl>
    </ul>


    ----- This outputs the following -----

    <ul><div>
    <li><a href="...">Item</a></li>
    </div><div>
    <li><a href="...">Item</a></li>
    </div></ul>

    ----- Should be just -----

    <ul>
    <li><a href="...">Item</a></li>
    <li><a href="...">Item</a></li>
    </ul>
     
    Andrew, Jun 19, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jademoon
    Replies:
    1
    Views:
    469
    jademoon
    Jul 12, 2005
  2. =?Utf-8?B?QW50aG9ueQ==?=

    Caching in a MCMS page

    =?Utf-8?B?QW50aG9ueQ==?=, Mar 29, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    460
    =?Utf-8?B?RFdT?=
    Mar 29, 2006
  3. Mark B
    Replies:
    3
    Views:
    382
    Alvin Bruney [MVP]
    Mar 22, 2007
  4. Stou Sandalski
    Replies:
    0
    Views:
    366
    Stou Sandalski
    Apr 19, 2007
  5. =?Utf-8?B?U2hvb3Rlcg==?=

    ASP.Net & MCMS Language problem

    =?Utf-8?B?U2hvb3Rlcg==?=, Jun 20, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    333
    =?Utf-8?B?U2hvb3Rlcg==?=
    Jun 21, 2007
Loading...

Share This Page