views:

20

answers:

1

Ok, my team has been having issues with the ajaxToolkit Tabs control, it doesn't play nice with parts of our site (mainly jquery issues, some other javascript, too many things to change)

So, I plan to write a different control that uses jQuery to achieve the tabbing functionality: I've done this before, and the jQuery is almost trivial. The thing I am having issues with is getting the Control itself to emulate the AjaxToolkit control, I'd like it to be a proper webcontrol with a content/header template structure.

However, I cannot seem to force asp to only allow these tags inside, as a repeater does with it's various <*template> tags, only get it to display these tags as options inside the markup. How would I achieve this functionality?

+2  A: 

The ContentTemplate like say a Repeater uses an ITemplate property with a few attribues, here's the pertinent info:

[ParseChildren(true), PersistChildren(false)]
public class Repeater : Control, INamingContainer
{
  [PersistenceMode(PersistenceMode.InnerProperty)]
  public virtual ITemplate HeaderTemplate { get; set; }

  [PersistenceMode(PersistenceMode.InnerProperty)]
  public virtual ITemplate ItemTemplate { get; set; }
}

It's a combination of ParseChildrenAttribute, PersistenceModeAttribute, and using the PersistChildrenAttribute to display them as inner tags.

Nick Craver
Thanks, now just to get the outer-layer functionality . . .
Ed Woodcock
@Ed - I had this same thing, I went about it a bit different, I had a parent control `Tabs` with a collection of `Tab` child controls, the end result is jQuery tabs on the client with not much rendering work, is that a possibility?
Nick Craver