tw是一个 System.IO.StringWriter 的对象原页面这样输出的。
Response.Write(tw.ToString())但是加了updatePanel后就不能这样做了,那么在UPdatpanel中应该用什么方法代替这个写法

解决方案 »

  1.   

    在aspx页form标签上面加个<span id="showmassage" runat="server" ></span>后台用showmassage.InnerHtml = tw.ToString();因为在updatepanle里不允许使用Response方法
      

  2.   

    1.ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('"+tw.ToString()+"')", true);
            
    2.也可以在页面放一个Label1,使Label1等于某一值
    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "document.getElementById('Label1').innerText='"+tw.ToString()+"'", true);