方法3.
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "tishi", "alert('你所查询的数据不存在!');", true);
方法4.
ClientScript.RegisterClientScriptBlock(this.GetType(), "tishi", "<script type=\"text/javascript\">alert('你所查询的数据不存在!');</script>");
5.公共方法:
/// <summary>
/// 显示提示消息对话框(alert)
/// </summary>
/// <param name="msg">消息内容</param>
public static void ShowMessage(string msg)
{
Page page = HttpContext.Current.Handler as Page;
if (page != null)
page.ClientScript.RegisterStartupScript(page.GetType(), "msg", "alert('" + msg.Replace("'","") + "');", true);
}