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
888
Inserting script during grid postback
posted

I am using the WebDataGrid and adding, deleting rows with no problem.  The issue I am having is that during an postback on the RowAdded event for the grid I am trying to use the following to insert a javascript function when the page comes back:

ScriptManager.RegisterStartupScript(this, this.GetType(), key, script, true);

The issue is the script never gets executed by the page.  I have tried this in an UpdatePanel and not.  Any ideas?

Parents
No Data
Reply
  • 14049
    Suggested Answer
    Offline posted

    If you are doing that inside of the grid's internal Ajax post back, this script will never make it to the client. The grid does not use the scriptmanager's mechanism in that case.

    To make it work you may want to try to wrap the grid with an UpdatePanel and set EnableAjax off the grid to False. In that case the grid will trigger a full postback, which will be intercepted by the UpdatePanel and the panel will bring the script to the client for you.

Children