html模板
public static bool WriteFile(string strText) 
    { 
        string path = HttpContext.Current.Server.MapPath("Html/"); 
        System.Text.Encoding code = System.Text.Encoding.GetEncoding("gb2312"); 
        string temp = HttpContext.Current.Server.MapPath("Html/A.html"); 
        StreamReader sr = null; 
        StreamWriter sw = null; 
        string str = ""; 
        try 
        { 
            sr = new StreamReader(temp, code); 
            str = sr.ReadToEnd(); 
        } 
        catch (Exception exp) 
        { 
            HttpContext.Current.Response.Write(exp.Message); 
            HttpContext.Current.Response.End(); 
            sr.Close(); 
        } 
        string htmlfilename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".html"; 
        //通过正则获取标签内容实现内容替换 
        try 
        { 
            sw = new StreamWriter(path + htmlfilename, false, code); 
            sw.Write(str); 
            sw.Flush(); 
        } 
        catch (Exception ex) 
        { 
            HttpContext.Current.Response.Write(ex.Message); 
            HttpContext.Current.Response.End(); 
        } 
        finally 
        { 
            sw.Close(); 
        } 
        return true; 
    } urlrewriter

解决方案 »

  1.   

    ASP.NET MVC  可以直接重定向啊  不在MVC里的话   改WEB.CONFIG 就可以了网上有介绍的转静态页
      

  2.   

    转静态页是不是需要有真实的静态页面?然后通过web.Config配置?
      

  3.   

    那个模板的静态页面,就是布局好了,模板就是提供<html></html>里面那些内容嘛,在相应位置替换内容。
      

  4.   

    要是一个项目如果有几十个上百个页面的话,难不成我每个页面都去写一个html的模板页。???
    要的不是这样的效果。
      

  5.   

    一般的网站只会将新闻等一些固定变的内容生成HTML 不会将全站生成的 大部分用的是伪静态
      

  6.   

    http://topic.csdn.net/u/20080624/10/26a45062-572c-47e9-bb38-d9aa05b6c2ed.html?47557
    还有分页  自己看看吧
    现在主流的就是url重写和模板替换  重写就是为静态  模板就是真正的html页面