title: Call JavaScript function on DropDownList SelectedIndexChanged Event:
body: <p>I have written one JavaScript function as follows:</p>
  
  <pre><code> function CalcTotalAmt() 
   {
      ----------
      -----------
   }
  </code></pre>
  
  <p>I have one DropDownList, </p>
  
  <pre><code>  &lt;asp:DropDownList ID="ddl" runat="server"  AutoPostBack="true" OnSelectedIndexChanged="ddl_SelectedIndexChanged"&gt;&lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>I need to call the above JavaScript function in the DropDownList's SelectedIndexChanged Event.
  I tried like below;</p>
  
  <pre><code>protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
  {
      ddl.Attributes.Add("onchange", "return CalcTotalAmt();");
  }
  </code></pre>
  
  <p>But the JavaScript function is not executing.
  How to call the JavaScript function in DropDownList Change Event?</p>