<A HREF="HTTP://服务器名/路径/文件名.DOC">打开</A>

解决方案 »

  1.   

    按钮事件中加入:(选中记录中包含word非格式化数据)
    DataTable chooseItem_dt = chooseItem();
    DataRow chooseDataLine = chooseItem_dt.Rows[0];
    Session["FileType"] = "application/msword";
    if (Session["sWord"] != null) 
    Session.Remove("sWord");
    Session["sWord"] = chooseDataLine["Unfordata"];
    this.H_Error.Value = "hasWordData";该页面的html中加入:
    <% if (this.H_Error.Value=="hasWordData") %>
    <script language="javascript">   
      window.open("ShowWordFile.aspx");     
    </script>
    ShowWordFile.aspx德pageload中加入:
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    Response.Expires = 0;
    Response.ContentType = "application/msword";
    Response.BinaryWrite((byte[])Session["sWord"]);
    Response.End();
    }
      

  2.   

    你可以用一个连接指向一个DOC文档,你可以选择打开或保存。两种方式都可以打开DOC。
      

  3.   

    actually it's quite simple.Response.ContentType = "Application/x-msword";
    string strFilePath="";

    strFilePath ="d:\\Report.doc";
    FileStream fs = new FileStream(strFilePath,FileMode.OpenOrCreate,FileAccess.Read);
    Response.WriteFile(strFilePath,0,fs.Length);
    fs.Close();