E
eebster
Hi,
Im trying to create a custom template in a control derived from a
linkbutton. I want someting like this:
<uc:SortButton id="sortId" runat="server">Column Name
<SortUpTemplate><img src="up.gif"></SortUpTemplate>
<SortDownTemplate><img src="down.gif"></SortDownTemplate>
</uc:SortButton>
Within the SortButton class I have an ITemplate property like this:
private ITemplate __sortDownTemplate = null;
[TemplateContainer(typeof(SortButtonContainer))]
public ITemplate SortDownTemplate
{
get {return __sortDownTemplate;}
set {__sortDownTemplate = value;}
}
If the SortButton control derives from WebControl the SortDownTemplate is
instantiated correctly but if it is derived from a LinkButton they are always
null. Is this not possible?
What Im hoping to achieve is have a generic sort button in which a developer
can define templated areas for the up and down arrows which I can then show
and hide as appropriate to whether the sort order is up or down. Any help
would be appreciated.
Ian
Im trying to create a custom template in a control derived from a
linkbutton. I want someting like this:
<uc:SortButton id="sortId" runat="server">Column Name
<SortUpTemplate><img src="up.gif"></SortUpTemplate>
<SortDownTemplate><img src="down.gif"></SortDownTemplate>
</uc:SortButton>
Within the SortButton class I have an ITemplate property like this:
private ITemplate __sortDownTemplate = null;
[TemplateContainer(typeof(SortButtonContainer))]
public ITemplate SortDownTemplate
{
get {return __sortDownTemplate;}
set {__sortDownTemplate = value;}
}
If the SortButton control derives from WebControl the SortDownTemplate is
instantiated correctly but if it is derived from a LinkButton they are always
null. Is this not possible?
What Im hoping to achieve is have a generic sort button in which a developer
can define templated areas for the up and down arrows which I can then show
and hide as appropriate to whether the sort order is up or down. Any help
would be appreciated.
Ian