The asp.net mobile controls Label has a backcolor property. How do I get that to be passed through to the markup that gets sent to the client?
Consider this:
<div id=code> </div> <div> <mobile:Label ID="Label4" Runat="server" BackColor="blue">Label Text</mobile:Label></div> <div>
this color doesn't get applied client side, even if I go to the site with a desktop browser, which should be detected as supporting that sort of thing.
It also depends on the device recognition by .net and the profiles you have on server (see the sticky post up top).
This workaround (I use a similar approach) will only work if .net detects the mobile device as a HTML32 device.. and without the above-mentioned profiles, .net detects my N70 as a WML phone..
I made a post about this problem before, but no luck finding a way to share profiles among developers.
None
0 Points
2 Posts
BackColor not working
Apr 05, 2006 07:19 PM|rabidwombat|LINK
Consider this:
<div id=code> </div> <div> <mobile:Label ID="Label4" Runat="server" BackColor="blue">Label Text</mobile:Label></div> <div>
this color doesn't get applied client side, even if I go to the site with a desktop browser, which should be detected as supporting that sort of thing.
What am I doing wrong?
Thanks</div>
Member
61 Points
65 Posts
Re: BackColor not working
Apr 06, 2006 11:02 AM|lchrennew|LINK
None
0 Points
8 Posts
Re: BackColor not working
Apr 09, 2006 10:43 AM|Y.attaHajjaj|LINK
None
0 Points
8 Posts
Re: BackColor not working
Apr 09, 2006 10:43 AM|Y.attaHajjaj|LINK
None
0 Points
5 Posts
Re: BackColor not working
Jul 10, 2006 09:33 AM|demo.ste|LINK
I have the same problem
Member
20 Points
162 Posts
Re: BackColor not working
Jul 14, 2006 09:24 PM|Frank Tse|LINK
well, a quick (but not elegant) workaround is to specify device specific content to write out a span tag with the background around the label:
<mobile:Panel runat=server>
<DeviceSpecific>
<Choice Filter="isHTML32">
<ContentTemplate>
<span style="background:white">
</ContentTemplate>
</Choice>
</DeviceSpecific>
</mobile:Panel>
<mobile:Label ID="Label4" Runat="server" BackColor="blue" ForeColor="green" >Label Text</mobile:Label>
<mobile:Panel runat=server>
<DeviceSpecific>
<Choice Filter="isHTML32">
<ContentTemplate>
</span>
</ContentTemplate>
</Choice>
</DeviceSpecific>
</mobile:Panel>
Note that the filter "isHTML32" is from the default mobile web.config that can be created in Visual Studio.
A better solution would be adding a new adapter to inherit and override HtmlLabelAdapter.Render method to write out the background style.
Member
10 Points
7 Posts
Re: BackColor not working
Aug 30, 2006 04:29 AM|jpsaravanan|LINK
Hi
i am also facing the same problem....
pls anybody know... help me out in this issue..
.NET Programmer
None
0 Points
15 Posts
Re: BackColor not working
Dec 11, 2006 03:35 PM|lekshmiS|LINK
Anyone got any solution for this problem?
None
0 Points
13 Posts
Re: BackColor not working
Dec 12, 2006 08:31 AM|prd|LINK
It also depends on the device recognition by .net and the profiles you have on server (see the sticky post up top).
This workaround (I use a similar approach) will only work if .net detects the mobile device as a HTML32 device.. and without the above-mentioned profiles, .net detects my N70 as a WML phone..
I made a post about this problem before, but no luck finding a way to share profiles among developers.
None
0 Points
3 Posts
Re: BackColor not working
Dec 14, 2006 03:45 PM|CKV|LINK
Looks like it's not rendering correctly. Same thing happen with Panel's back color.
And in textbox also, some style doesn't work.
Solution: Need to override render method as explained by Frank. (didn't try yet, but once i m done, i will update here)
None
0 Points
8 Posts
Re: BackColor not working
Oct 21, 2008 08:36 AM|kyatham79|LINK
Can anyone tell me how to set backcolor for lable and panel I am facing the same problem
Member
23 Points
58 Posts
Re: BackColor not working
Mar 24, 2009 07:07 AM|codetoad|LINK
Somebdy help us all. We are the sufferers
None
0 Points
1 Post
Re: BackColor not working
Dec 05, 2011 04:56 PM|Vaxx|LINK
Help, I have the same issue.