Hi Dmitry,
As for the ASP.NET Label DataBinding backColor color problem, I have also
performed some tests on my side and did repro the same behavior. Actually,
here is something else I also got:
The problem is not specific to FormView but seems a binding issue of the
Label control. I can get this behavior even through the following simple
routine:
** put a Label on the top level of aspx form
** and use a page variable to perform databinding against the Label control
** After click another posback button, the previous bound color
lost(Forecolor property also suffers this problem)
Currently I'll do some further research on this and will update you if
there is any new finding or information.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Dmitry Duginov" <di**@nospam.nospam>
Subject: BackColor binding does not work on postback
Date: Fri, 28 Sep 2007 10:10:07 -0400
>
Hi,
I have the following label markup (label is inside FormView):
<asp:Label
ID="lblIndicatorReady" runat="server" Text="RE" ToolTip="Ready"
BackColor='<%#
Eval("Ready").ToString()=="True"?System.Drawing.C olor.FromName("#FFFF80"):S
ystem.Drawing.Color.White
>%>'
Enabled='<%# Eval("Ready") %>'
Font-Bold='<%# Eval("Ready") %>'>
</asp:Label>
I.e. late binding for the "Ready" property used to determine should the
label be
(bold, highighted and enabled) or (plain, white background, disabled)
On initial load everything works as expected (for ready items label is
colored). But on postbacks BackColor is always white for some reason.
Enabled and Bold properties are shown correctly though.
Any ideas?
Dmitry.