Thursday, September 25, 2008

Coding for changing form background color using CSS

public void Menu_Color_Selection_Method()
{
string color_name = DropDownList1.SelectedValue.ToString();
string path = "CSS\\";
string filename = color_name.ToString();
string extension = ".css";
stylesheet.Href = path + filename + extension;
Image1.ImageUrl = "images\\" + color_name + "_image.jpg";
}

No comments: