how to write javascript validation for dropdown selected index changed event in c#
<p>I have a dropdown.Basing on this dropdown i shud load another dropdown.i wrote code in on selected index changed event in .cs page.Depending on selectd item in first dropdown i need to give a validation in javascript.let us think i should show an alert.Can any one help me out.</p>

<p>in .aspx page</p>

<pre><code>&lt;asp:DropDownList ID="drpdes" runat="server" onselectedindexchanged="drpdes_SelectedIndexChanged"&gt;&lt;/asp:DropDownList&gt;
</code></pre>

<p>in .cs page</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
         drpdes.AutoPostBack = true;
    }

 protected void drpdes_SelectedIndexChanged(object sender, EventArgs e)
    {
         int flgchk = 0;
          if(drpdes.selectedvalue == "0")
           {
                flgchk = 1;
           }
        // my code for binding second dropdown
    }
</code></pre>

<p>when flgchk = 1 i need to show an alert from javascript.i wrote a function for alert in javascript.But i am not understanding where to call it.</p>
