Monday, December 29, 2014

Call to javascript Function from code behind using ScriptManager.RegisterStartupScript

 protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "staffterminalITstaff", "function GetTerminalITStaff(){return '" + hdnstaffjson.ClientID + "';}", true);
           }
        }
 protected override void OnPreRender(EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), "LoadBP", "LoadBP('" + hdnLanguage.ClientID + "','" + ddlLanguage.ClientID + "');", true);

        }

No comments: