Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ITemplates wrapped in extra <div> tags by .net 2.0 / MCMS

Reply
Thread Tools

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

 
 
Andrew
Guest
Posts: n/a
 
      06-19-2006
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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boost.Python create extra functions not in wrapped object Stou Sandalski Python 0 04-19-2007 07:37 AM
Strange viewstate problem with MCMS Mark B ASP .Net 3 03-22-2007 12:26 AM
Any SharePoint or MCMS exams? Michael MCSD 0 06-02-2006 10:56 PM
Caching in a MCMS page =?Utf-8?B?QW50aG9ueQ==?= ASP .Net 1 03-29-2006 04:25 PM
ASP.Net and error messages from submitting a MCMS posting jademoon ASP .Net 1 07-12-2005 05:05 PM



Advertisments