Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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="
HTML
<table style="background-color:"><tr><td>hello</td></tr></table>
"
 
Share this answer
 
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:

C#
yourTableID.BgColor = "SomeColorFromDatabase";
 
Share this answer
 
Comments
Rockstar_ 18-Apr-13 6:37am    
Wah!..Great..!
Zafar Sultan 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900