dynamic color schemas with ASP.NET

O

Oleg Ogurok

Hi all,

In my web application, I'm trying to allow users to customize colors by
choosing schemas. I would also like to allow them to modify schema values.
I've decided to store the color schemas in DB. Now I'm trying to find a good
way to apply the schema values from DB onto the page controls at runtime.

I understand, there are 2 ways:
1. Manually set every control's properties lke .Color, .BackgroundColor,
etc. This method can be inefficient as the number of controls grows.
2. Use CSS styles and hardcode CssClass property on each control. This
method seems reasonable; however, I will need to generate CSS classes on the
fly, and so far I couldn't locate any API for doing it.

If there is a better way, please let me know.
Your feedback is greatly appreciated.

-Oleg.
 
G

Guest

Hi

You can add style in code-behind, like

WebControl.Style("color") = "red

So as long as you can get the user's preference either from memory or from database, you can set the style in code

Bin Song, MCP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top