📜  asp.net 注销客户端脚本 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:06.978000             🧑  作者: Mango

代码示例1
protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        if (Session["info"] == null)
        {
            string message = "Information to display";
            ClientScript.RegisterStartupScript(this.GetType(), "Popup", "alert('" + message + "');", true);
            Session["info"] = true;
        }
        else
        {
            //Remove the script
            ClientScript.RegisterStartupScript(this.GetType(), "Popup", "", false);
        }
    }
}