Wednesday, June 2, 2010

Change Theme Folder Style Sheet ASP.NET

01.Add New Style Sheet in to the theme folder.
02.Write Bellow Code in to the Code Behind.

string css = @"<link )="" +="" @="" app_themes="" blue="" css="" href="" rel="" stylesheet2.css="" stylesheet="" text="" this.resolveurl(="" type=""></link>";

ScriptManager.RegisterClientScriptBlock(this.Page, GetType(), "_calcss", css, false);


It Replace In .aspx Page Like>>>>>>>>>>>



<head><title>

</title><link href="App_Themes/Red/StyleSheet.css" type="text/css" rel="stylesheet" /><link href="App_Themes/Red/StyleSheet2.css" type="text/css" rel="stylesheet" /></head>

<body>
<form name="form1" method="post" action="WebForm1.aspx" id="form1">
<div>

</div>

<link href="/App_Themes/Blue/StyleSheet2.css" type="text/css" rel="stylesheet" />


Refer:http://www.west-wind.com/weblog/posts/158367.aspx

No comments:

Post a Comment