保存到客户端
<body >

<input type="button" value="Save" onclick="SaveText()">

<script>
function SaveText()
{
    //取得id=tb的表格的HTML代码.
    var strHTML = tb.outerHTML;
    var winSave = window.open();
    winSave.document.open ("text/html","gb2312");
    winSave.document.write (strHTML);
    winSave.document.execCommand ("SaveAs",true,"table.htm");
    winSave.close();
}
</script>
<table id="tb">
<tr>
<td>tttttttt</td>
</tr>
<tr>
<td>tttttttt</td>
</tr>
</table>

解决方案 »

  1.   

    看看这个行不行,
    http://dotnet.aspx.cc/ShowDetail.aspx?id=BC72C21B-5694-43AF-2C75-C1DEFBBE3769
      

  2.   

    XmlHttp.htm
    <html>
     <head>
      <title>Lion互动网络==》在客户端用XmlHttp取得服务器端的DataSet数据</title>
      <meta http-equiv="Pragma" content="no-cache">
     </head>
     <body>
      <INPUT id="Button1" onclick="GetDataSet()" type="button" value="取得XmlHttp.Aspx中的DataSet以Xml形式显示"
       name="Button1">
      <div id="abc"><FONT face="宋体"></FONT></div>
    <script language="jscript">
    function CreateXMLHTTP()
    {
     try{return new ActiveXObject('MSXML2.XMLHTTP');}catch(x){}
     try{return new ActiveXObject('Microsoft.XMLHTTP');}catch(x){}
     throw(new Error(-1,'不能创建XMLHTTP'));
    }
    function GetDataSet()

     var xmlhttp = CreateXMLHTTP();
     var url = document.location.href;
     url = url.substring(0,url.lastIndexOf("\/")+1)+"XMLHTTP.aspx";
     xmlhttp.open("GET",url,false)
     xmlhttp.setRequestHeader("Content-Type","text/xml")
     xmlhttp.send()
     abc.innerText = (xmlhttp.responseXML.xml);
     
    }
    </script>
     </body>
    </html> XMLHTTP.aspx
    <%@ Page language="c#" Codebehind="XMLHTTP.aspx.cs" Src="XMLHTTP.aspx.cs" AutoEventWireup="false" Inherits="Exam.WebForm1" %>XMLHTTP.aspx.cs
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace Exam
    {
     /// <summary>
     /// WebForm1 的摘要说明。
     /// </summary>
     public class WebForm1 : System.Web.UI.Page
     {
      private void Page_Load(object sender, System.EventArgs e)
      {   
       // 在此处放置用户代码以初始化页面
       
       System.Data.DataTable DT = new System.Data.DataTable("temptable");
       DT.Columns.Add("ID",typeof(int));
       DT.Columns.Add("Name",typeof(string));
       DT.Columns.Add("AddTime",typeof(DateTime));
       DT.Columns[0].AutoIncrement = true;
       DT.Columns[0].AutoIncrementSeed = 1;
       DT.Columns[0].AutoIncrementStep = 1;
       for(int i=0;i<20;i++)
       {
        System.Data.DataRow dr= DT.NewRow();
        dr[1] = "欢迎光临Lion互动网络,第 "+ (i+1) +" 行";
        dr[2] = System.DateTime.Now.AddDays(i);
        DT.Rows.Add(dr);
       }
       System.Data.DataSet ds = new System.Data.DataSet("Root");
       ds.Tables.Add(DT);
       Response.Buffer=true;
       Response.CacheControl="no-cache";
       Response.ContentType = "text/xml";
       Response.Clear();
       Response.Write("<?xml version='1.0' encoding='gb2312'?>");
       Response.Write(ds.GetXml());
       Response.End();
       DT.Clear();
       DT.Dispose();
       ds.Clear();
       ds.Dispose();
       
      }  #region Web 窗体设计器生成的代码
      override protected void OnInit(EventArgs e)
      {
       //
       // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
       //
       InitializeComponent();
       base.OnInit(e);
      }
      
      /// <summary>
      /// 设计器支持所需的方法 - 不要使用代码编辑器修改
      /// 此方法的内容。
      /// </summary>
      private void InitializeComponent()
      {    
       this.Load += new System.EventHandler(this.Page_Load);  }
      #endregion
     }
    }
      

  3.   

    偶也是这样想,但是上头要求这样做。还有,还说必须要把实际的网页发送给列表中的所有联络人,不能发送一个地址然后他们通过链接打开来看。孟子大哥教了我怎样把网页转换成string,但是我不知道转换以后发送给用户,用户打开邮件会出现什么效果呢?能自动还原成网页吗?客户打开邮件能不能看到嵌在邮件文档中的网页效果?
      

  4.   

    可以做一个框架页,把实现的网页地址设为框架页内嵌的框架的url,然后把这个框架页发给用户,用户打开框架页后内嵌的页面就会下载下来。
      

  5.   

    客户在邮件里能不能看到 网页 的看他的邮件 支持不支持html格式,很多都不支持的