Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Is it possible to run jscript on postback?
posted

I have a WDG in an UpdatePanel. When the page first loads, it looks at the dimensions of the page and sets the WDG size accordingly. 

 

When I do anything that causes a PostBack, this sizing is destroyed. I need a way to execute a script that resizes the grid on PostBack. 

 

Help? 

Parents
No Data
Reply
  • 395
    Verified Answer
    posted

    Found the answer: 

     

    Use the ScriptManager's 'RegisterStartupScript' method to kickoff the function after databinding has occured. Works perfectly, so I help this winds up helping someone else.

     

    protected void MasterGrid_DataBound(object sender, EventArgs e)

            {

                ScriptManager.RegisterStartupScript(this, this.GetType(), "resizeGridMasterGrid", "resizeGrid();", true); 

            }

Children
No Data