I have style sheet with a class name “changebackgroundcolor” i want make change in css class at run time that color will change.
.changebackgroundcolor{
background-color: #21606E;}
if i change the back ground code in my color picker then it will make change here permanently.
is there any jquery for this or any asp.net code.
What i do for this?
It is possible, but it’s not advisable. What you’re proposing is to make your asp.net application into a file editor. That would involve raising the privileges for your application’s security context (the user under which it runs) which opens a big can of worms.
The simplest alternative is to inject classes into your asp.net page by writing a new
<style type="text/css">element to your page that includes the css classes you want to produce dynamically.For example, you might save the
background-colorto aUserSettingstable (or any other per-user persistence mechanism), then load it into your .aspx page like this:Or you could keep the class definitions in a css file. Instead of emitting the classes directly into the page, dynamically write some jQuery code to change the definition of the class, following some of the examples from other answers.