Here I only switch between the two skins,
1. First, we need to create two master boards with the same frame structure;
2. Create a content page and reference the default dashboard page;
3. Write the following in the. cs file on the new page:
Code
Protected void Page_PreInit (object sender, EventArgs e)
{
If (Request. Cookies ["Theme"]! = Null)
{
This. Theme = Request. Cookies ["Theme"]. Value;
This. MasterPageFile = "~ /"+ Request. Cookies [" Theme "]. Value +". master ";
}
}
Protected void Page_Load (object sender, EventArgs e)
{
If (! IsPostBack & Request. Cookies ["Theme"]! = Null)
This. DropDownList1.SelectedValue = Request. Cookies ["Theme"]. Value;
}
Protected void dropdownlistincluselectedindexchanged (object sender, EventArgs e)
{
Response. Cookies ["Theme"]. Value = DropDownList1.SelectedValue;
Response. Redirect (Request. Url. AbsoluteUri );
}
Source code:/Files/KingStar/WebApplicationSkin.rar