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:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...