14
Answers

unable to call the jquery function from codebehind,

Ask a question
ashok kumar

ashok kumar

11y
2.3k
1
hi,
  iam using an jquery function which needs to be called in the codebehind,on buttonclick it should be invoked which should set the open the tooltip for the dropdown,
the problem is the dropdown is inside the updatepanel, so iam not able to call the jquery code.break point is reaching the validation function but the jqueryfunction is not invoked.when i remove the dropdown carsegment from update panel its working fine,pls help me out.

aspx:
   function ddlcar() {
              var controlNames = "<%= ddlCarSegment.ClientID%>";
              $('#' + controlNames).tooltip("open");
             
          }

 protected void book_click(object sender, EventArgs e)
    {
        // ClientScript.RegisterClientScriptBlock(this.GetType(), "blah", "ddlcar();", true);
        if (!Validation())
        {
            return;
        }}

 protected Boolean Validation()
    {
        
        
        if (ddlCarSegment.SelectedIndex == 0)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "modalscript",
                " ddlcar();", true);
         
            return false;
        }
}



Answers (14)