Prev | Current Page 736 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

AddTemplateDefinition(templateDef);
//Footer
templateDef = new TemplateDefinition(this, "Footer",
ctl, "FooterTemplate", false);
templateGroup.AddTemplateDefinition(templateDef);
// Add the TemplateGroup to the TemplateGroupCollection
templateGroupCol.Add(templateGroup);
}
return templateGroupCol;
}
}
572 CHAPTER 11 ?–  DESIGN-TIME SU PPORT
public override string GetDesignTimeHtml()
{
//Return configuraiton instructions if no templates are set.
if ((null == ((Repeater)Component).HeaderTemplate) &&
(null == ((Repeater)Component).SeparatorTemplate) &&
(null == ((Repeater)Component).ItemTemplate) &&
(null == ((Repeater)Component).AlternatingItemTemplate) &&
(null == ((Repeater)Component).FooterTemplate))
{
return CreatePlaceHolderDesignTimeHtml("Click here and use
the task menu to edit Repeater Header, Footer, and
Seperator template properties. " +
"
A default template is used at run-time if the separator Template is
not specified at design-time." +
"
The Header and Footer templates are optional.");
}
//return configured html
string designTimeHtml = String.Empty;
try
{
((Repeater)Component).DataBind();
designTimeHtml = base.GetDesignTimeHtml();
}
catch (Exception e)
{
designTimeHtml = GetErrorDesignTimeHtml(e);
}
return designTimeHtml;
}
public override bool AllowResize
{
get
{
bool templateExists =
null !=((Repeater)Component).


Pages:
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748