<table style="width: 100%; background-color: #B5C7DE">
i have this table and want to change the background-color to be yellow if the server used int he SQL connection string is not ‘pheddv20’
i am adding c# code to the page load event to check for this and run the dynamic logic. the connection string is held in the web.config as is typically seen…
whats the code look like for this type of action?
It’s better to mark the table with a css class:
In your code behind you’d want to add the method
This wasn’t in your post, but I’m guessing you want to have the table show up in different colors depending on the environment (ie. debug/release/qa). You should look into using web.config transormations. If you do that you can use conditional compilation statements in your code behind and you won’t have to rely on web.config parsing. So your method becomes