Thursday, July 22, 2010

How to register a startup (document).ready(..) script only for the first page load - Asp.net, JQuery, JavaScripts

public partial class Test : Page
{
    private string script = @"
        $(document).ready(function () {
            
        });
    ";
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        if (!this.Page.IsPostBack)
            this.Page.ClientScript.RegisterStartupScript(
                this.GetType(), 
                this.GetType().Name, 
                this.script, 
                true);
    }
}

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...