Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

asp.net unregister client script

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);
        }
    }
}
Source by www.aspsnippets.com #
 
PREVIOUS NEXT
Tagged: #unregister #client #script
ADD COMMENT
Topic
Name
4+9 =