Asp.Net下通过切换CSS换皮肤
直接重写Render事件
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringWriter sw = new StringWriter() ;
HtmlTextWriter htmlWriter = new HtmlTextWriter(sw) ;
base.Render(htmlWriter) ;
//当前用户选择的风格css
string css = "<link href=\"css url\" rel=\"stylesheet\" type=\"text/css\">" ;
string html = sw.ToString() ;
int startPoint = html.IndexOf("</head>", StringComparison.CurrentCultureIgnoreCase);
if (startPoint > 0)
{
html = html.Insert(startPoint, css);
}
writer.Write(html) ;
}
把这个放在每个页面的基类PageBase里。那就方便多了。
当然,如果不想在让每个page都继承自定义的基类的方式,那也可以通过在HttpModule里写。也很方便.
一处写好,页页受用呀
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/21aspnet/archive/2009/02/02/3858024.aspx
相关文档:
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<!--
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0 ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using  ......
一说到新闻系统的话,一定会谈到静态页面生成的,因为静态页面不但是读取速度快,而且又安全;
静态页面的生成不管是小到现在的企业网站大至网易,QQ等门户都用到了;
那么我们如何来生成静态页呢?
以什么方式生成静态页面呢……
在生成静态页面的时候有那些是要注意的呢:
静态页面命名
统一存放目录 ......
法一:调用winrar
using Microsoft.Win32;
using System.Diagnostics;
protected void Button1_Click(object sender, EventArgs e)
{
RAR(@"E:\95413594531\GIS", "tmptest", @"E:\95413594531\");
}
/// ......
Label——height:高度
width:宽度
backcolor:背景色
......