在配置文件中动态更改主题
1.在配置文件中添加主题内容:
<appSettings>
<add key="EnterVideoHelp" value="..\HelpVideo\Help.swf"/>
<add key="SysVideoHelp" value="..\HelpVideo\Help.swf"/>
<add key="AppName" value="移动考勤管理平台" />
</appSettings>
2.添加类文件WebConfigCache.cs:
3.页面中引用:
<title> <%=WebConfigCache.AppName%></title>
<appSettings>
<add key="EnterVideoHelp" value="..\HelpVideo\Help.swf"/>
<add key="SysVideoHelp" value="..\HelpVideo\Help.swf"/>
<add key="AppName" value="移动考勤管理平台" />
</appSettings>
2.添加类文件WebConfigCache.cs:
1
public class WebConfigCache
2
{
3
public static readonly string AppName = ConfigurationManager.AppSettings["AppName"];
4
public static readonly string Signature = ConfigurationManager.AppSettings["Signature"];
5
6
private WebConfigCache() { }
7
static WebConfigCache() { }
8
}
public class WebConfigCache2
{3
public static readonly string AppName = ConfigurationManager.AppSettings["AppName"];4
public static readonly string Signature = ConfigurationManager.AppSettings["Signature"];5

6
private WebConfigCache() { }7
static WebConfigCache() { }8
}3.页面中引用:
<title> <%=WebConfigCache.AppName%></title>


浙公网安备 33010602011771号