H
Homer J. Simpson
Hi all,
I'm trying to manipulate a calendar header's style programmatically at
runtime. This works:
<asp:Calendar id="clndr" [...]>
Page_Load()
{
clndr.TitleStyle.BackColor = System.Drawing.Color.FromArgb( 255, 0, 0 );
}
This, however, doesn't:
Page_Load()
{
clndr.TitleStyle.CssClass.Insert( 0, "background-color: #FF0000;" );
}
Am I misinterpreting the intent behind CssClass.Insert()?
I know I could stick with TitleStyle.BackColor, but what I'm ultimately
trying to do is specify an attribute that isn't recognized as a member of
clndr.TitleStyle.CssClass. I'm just experimenting for now. This
calendar--being ported from classic ASP--used to have the following style:
..title
{
filter:
progidXImageTransform.Microsoft.Gradient(startColorStr='#000000',
endColorStr='#D4D0C8', gradientType='1');
}
Obviously, "filter" isn't a member of clndr.TitleStyle (so I couldn't change
its startColorStr or endColorStr values), so I thought I could get around
that with something like:
string strFilter = "filter:
progidXImageTransform.Microsoft.Gradient(startColorStr='#000000',
endColorStr='#D4D0C8', gradientType='1');";
clndr.TitleStyle.CssClass.Insert( 0, strFilter ).
However my test above with the background-color attribute tells me I'm doing
something wrong. If I could get *that* to work first, then I'll try to get
the filter attribute to work next...
I'm trying to manipulate a calendar header's style programmatically at
runtime. This works:
<asp:Calendar id="clndr" [...]>
Page_Load()
{
clndr.TitleStyle.BackColor = System.Drawing.Color.FromArgb( 255, 0, 0 );
}
This, however, doesn't:
Page_Load()
{
clndr.TitleStyle.CssClass.Insert( 0, "background-color: #FF0000;" );
}
Am I misinterpreting the intent behind CssClass.Insert()?
I know I could stick with TitleStyle.BackColor, but what I'm ultimately
trying to do is specify an attribute that isn't recognized as a member of
clndr.TitleStyle.CssClass. I'm just experimenting for now. This
calendar--being ported from classic ASP--used to have the following style:
..title
{
filter:
progidXImageTransform.Microsoft.Gradient(startColorStr='#000000',
endColorStr='#D4D0C8', gradientType='1');
}
Obviously, "filter" isn't a member of clndr.TitleStyle (so I couldn't change
its startColorStr or endColorStr values), so I thought I could get around
that with something like:
string strFilter = "filter:
progidXImageTransform.Microsoft.Gradient(startColorStr='#000000',
endColorStr='#D4D0C8', gradientType='1');";
clndr.TitleStyle.CssClass.Insert( 0, strFilter ).
However my test above with the background-color attribute tells me I'm doing
something wrong. If I could get *that* to work first, then I'll try to get
the filter attribute to work next...