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)



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 18 Apr 2013
Copyright © CodeProject, 1999-2014
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