ASPX 後臺調用前臺Js

一、UpdatePanel 使用中測試

protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = "測試時間:" + DateTime.Now.ToString();this

ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(),"testalert", "<script>Test();</script>", false);
}blog

二、UpdatePanel 沒有使用ip

protected void Button1_Click(object sender, EventArgs e)
{
    this.Label1.Text = "測試時間:" + DateTime.Now.ToString();
    ClientScriptManager cs = this.ClientScript;
    cs.RegisterStartupScript(this.GetType(), "HelloWorld", "<script>alert('test alert');</script>");
}test

 

源代碼下載:http://files.cnblogs.com/tianjinquan/WebReportJS.zipobject

相關文章
相關標籤/搜索