ajax弹出窗口提示与弹出窗口

如果用了UpdatePanel 弹出的写法:

ScriptManager.RegisterStartupScript(this.UpdatePanel1,Page.GetType(),"","alert('弹出提示!');",true);

ScriptManager.RegisterStartupScript(this.UpdatePanel1,Page.GetType(),"","openDialog('DictionaryTvAdd.aspx?NodeId=" + lb_NodeId.Text + "&NodeName=" + Server.UrlEncode(tb_s_name.Text) + "');",true);

友情提示:如果传值是中文请转换编码:

如:NodeName=" + Server.UrlEncode(tb_s_name.Text) + "'

在页面接收时同样转换:

如: tb_NodeName.Text = Server.UrlDecode(Request.QueryString["NodeName"].ToString());

如果没用UpdatePanel弹出的写法:

ClientScript.RegisterStartupScript(this.GetType(),"script","alert(弹出提示!);",true);

ClientScript.RegisterStartupScript(this.GetType(),"script","openDialog('DictionaryTvAdd.aspx?NodeId=" + lb_NodeId.Text + "&NodeName=" + Server.UrlEncode(tb_s_name.Text) + "');",true);

你可能感兴趣的:(Asp.Net,ajax)