I'm new to ASP so a complete noob with C#, however I am strong in css/html and know some Javascript.
I have an ASP.NET web-app using an external "style.css" - please note that I hate using inline styles.
I want to modify the colour of an element based on user credentials from the server.
(In style.css): .userColour {background-color: #3c3c3c;}
So when the user logs in: (In C# of page):
- fetch user colour (for this user) from server (assume user has already been verified)
- scan style.css for the #3c3c3c colour value
- overwrite colour value to new users colour #whatever
- serve the page
Getting the user colour from the server probably has too many methods to warrant an answer here - I just need to be shown some basic method of addressing the style.css and iterating through it overwriting the colour value and saving it on completion.
Please note: I don't want to add or modify css classes server-side, or add inline styles, etc. I want to have the flexibility to assign ANY colour value at a later stage and for the app this is the most appropriate solution.
Thanks.