It appears that the CSSControlAdapters do not properly databind templates. in particular, the header and footer templates.
Here are the steps to reproduce this on the published samples:
In DataList.aspx change this
<asp:DataList id="MyDataList" SkinID="SampleDataList" DataSourceID="ContactsDS" RepeatColumns="4" RepeatDirection="Vertical" runat="server" CssSelectorClass="PrettyDataList">
<HeaderTemplate>
Authors from Pubs
</HeaderTemplate>
to
<asp:DataList id="MyDataList" SkinID="SampleDataList" DataSourceID="ContactsDS" RepeatColumns="4" RepeatDirection="Vertical" runat="server" CssSelectorClass="PrettyDataList" OnItemDataBound="MyDatalist_ItemDataBound">
<HeaderTemplate>
Authors from Pubs <asp:HyperLink ID="SwitchView" runat="server" Text="Summary View" ToolTip="Switch to the Summary View" />
</HeaderTemplate>
and in the code behind, add this:
protected void MyDatalist_ItemDataBound(object sender, DataListItemEventArgs e)
{
switch (e.Item.ItemType)
{
case ListItemType.Header:
HyperLink SwitchView = (HyperLink)e.Item.FindControl("SwitchView");
SwitchView.NavigateUrl = "xyz";
break;
}
}
You can see that, without the adapter, the navigateUrl is properly set on the link. With the adapter in place, the ID of the control is not properly generated and the href property is not set.
Any ideas?
Thanks,
Michael.