I have an Update panel where a button and a grid are added as follows: this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._BtnSave); this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._AssignGrid);
On click of this button I am calling a function which resides in a different class AssignedGrid.cs. this._AssignedGrid.getSelectedRows();
AssignedGrid.cs inturn calls a javascript function as follows:
public void getSelectedRows()
{
this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "GetSelectedItems", "<script type='text/javascript' language='javascript'>GetSelectedItems();</script>");
}
But this javascript function is never called! Please let me know if I am calling the function the proper way.
ClientScriptyou need to useScriptManagerto callRegisterStartupScript