Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET HTML CSS3
good evening friends . i am working on a page where i need to change color code of a table , i am pickiing that color code from database.
Could you please help me how can i do this
Posted 18-Apr-13 1:25am
pawanvats1.3K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi,
 
Copy the table's HTML code in a string variable, then on the table background property apply the color you retrieved from database.
 
ex string str="
<table style="background-color:"><tr><td>hello</td></tr></table>
"
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You have to use runat="server" ID = "yourTableID" to convert an HTML table into server side control. Then use the following property in the code behind:
 
yourTableID.BgColor = "SomeColorFromDatabase";
  Permalink  
Comments
Member61 at 18-Apr-13 6:37am
   
Wah!..Great..!
Zafar Sultan at 18-Apr-13 6:39am
   
Why?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Zoltán Zörgő 260
1 /\jmot 205
2 CHill60 145
3 CPallini 135
4 Peter Leow 135
0 Sergey Alexandrovich Kryukov 9,373
1 OriginalGriff 6,881
2 Peter Leow 4,577
3 Zoltán Zörgő 4,244
4 CHill60 2,892


Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 18 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100