Click here to Skip to main content
11,576,891 members (59,023 online)
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 0: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 Sergey Alexandrovich Kryukov 221
1 DamithSL 155
2 Abhinav S 130
3 OriginalGriff 95
4 Lucifier Rocks 85
0 OriginalGriff 715
1 Sergey Alexandrovich Kryukov 631
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web03 | 2.8.150603.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