Prev | Current Page 837 | Next

Rob Cameron and Dale Michalk

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

AlternatingItemTemplate ||
null != ((Result)Component).ItemTemplate ||
null != ((Result)Component).SeparatorTemplate ||
null != ((Result)Component).FooterTemplate;
return templateExists || InTemplateMode;
}
}
///
/// Provides HTML for the visual designer to display
///

/// HTML string based on rendering the
/// control with a dummy data source

public override string GetDesignTimeHtml()
{
Result control = (Result)Component;
string designTimeHTML = null;
// bind Result control to dummy data source
// that has the appropriate page size
control.DataSource =
ResultDummyDataSource.GetLiveSearchResults(control.PageSize);
control.DataBind();
// let base class designer call Render() on
// data-bound control to get HTML
designTimeHTML = base.GetDesignTimeHtml();
return designTimeHTML;
}
///
/// HTML rendered when control has an "error" in its configuration
///

/// HTML string
CHAPTER 13 ?–  P ACKAGI NG AND DEPLOYMENT 663
protected override string GetErrorDesignTimeHtml(Exception e)
{
return CreatePlaceHolderDesignTimeHtml(
"There was an error rendering the TemplateMenu control." +
"
Exception: " + e.Source + " Message: " + e.


Pages:
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849