aspx页面生成html
2011-12-07 00:02
302 查看
ToHtml.aspx
protected void Page_Load(object sender, EventArgs e)
{
//使用示例:
//ToHtml.aspx?src=default.aspx 生成default.html
//ToHtml.aspx?src=default.aspx?tag=index.html 生成index.html
string source = Request.Params["src"];
string target = Request.Params["tag"];
if (target == null || target.Trim().Length == 0)
{
target = source.Replace(".aspx", ".html");
}
StreamWriter sw = new StreamWriter(Server.MapPath(target), false, System.Text.Encoding.GetEncoding("utf-8"));
Server.Execute(source, sw);
sw.Close();
//Response.Redirect(target);
}
protected void Page_Load(object sender, EventArgs e)
{
//使用示例:
//ToHtml.aspx?src=default.aspx 生成default.html
//ToHtml.aspx?src=default.aspx?tag=index.html 生成index.html
string source = Request.Params["src"];
string target = Request.Params["tag"];
if (target == null || target.Trim().Length == 0)
{
target = source.Replace(".aspx", ".html");
}
StreamWriter sw = new StreamWriter(Server.MapPath(target), false, System.Text.Encoding.GetEncoding("utf-8"));
Server.Execute(source, sw);
sw.Close();
//Response.Redirect(target);
}
相关文章推荐
- 将aspx的动态页面生成静态的HTML页面
- C#动态页面aspx生成静态html解决方案!
- 美工作出来的页面都是html格式的~闲来无事~写了个程序用来转换html格式页面为aspx格式,并为之生成cs文件
- aspx生成静态页面html 例子
- 关于aspx 页面生成html 源码顶部空行不得不说的事儿
- 动态.aspx页面生成静态.html页面 学习总结
- aspx页面生成html
- ASPX 生成html静态页面的问题
- 【转载】C#动态页面aspx生成静态html解决方案
- [转]把动态页面.aspx 生成静态页面.html
- aspx生成静态页面html 例子
- 获得aspx页面生成的HTML
- .net将动态页面(aspx)生成静态页面htm | html
- aspx生成静态页面html 例子
- ASPX页面生成HTML的方法
- 动态生成html缓存页面
- ASP.NET动态生成HTML页面
- ASP.NET动态生成HTML页面