<HeaderStyle BackColor="<%= ssponcont %>"> </HeaderStyle>
...doesnot work as a Parser error renders: Content ('<HeaderStyle
BackColor=') does not match any properties within a
'System.Web.UI.WebControls.DataList', make sure it is well-formed
dl.HeaderStyle.BackColor = Color.Red;
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
".Net Sports" <ballz...@cox.net> wrote in message
news:1e75f9e9-a7b7-474d...@i36g2000prf.googlegroups.com...
<asp:DataList id="dlstCats" runat="server" RepeatColumns="4"
width="350px" ItemStyle-BackColor="#ccffcc" cellspacing="3">
<HeaderStyle BackColor="#008000"> </HeaderStyle>
<HeaderTemplate> <font class="body11-
wh">Providers for
<%= sregionZ %>: <%= Zonecustom() %></font> </
HeaderTemplate>
<ItemTemplate><font class="body9bold-re"> <a
href="re.aspx?zone=<%#Server.UrlEncode(Request.QueryString("zone")) &
"&cregion=" & Server.UrlEncode(Request.QueryString("cregion")) &
"&category=" & (Eval("Category").ToString())%>">
<%# Eval("Category")%>
</a></font></ItemTemplate>
</asp:DataList>
as you see, I can provide dynamic variables from helper functions in
the headers of my page to stuff inside the Header Template & the
ItemTemplate, but I need to dynamically also change the HeaderStyle
BackColor property here
TIA
.netsports
On Apr 16, 5:39 pm, "Mark Fitzpatrick" <markf...@fitzme.com> wrote:
> Do it programatically. You can access the property directly from code as
> follows:
> assume the name of the datalist is dl
>
> dl.HeaderStyle.BackColor = Color.Red;
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - Expression
>
> ".Net Sports" <ballz2w...@cox.net> wrote in message
I suggest you wrap your HeaderTemplate content in a div and
dynamically assign a style to that element. Something like:
<HeaderTemplate>
<div style='background-color:<%= ssponcont %>' >
<font class="body11-wh">Providers for <%= sregionZ %>: <%=
Zonecustom() %></font>
<div>
</HeaderTemplate>
============
Regards,
Steve
www.stkomp.com