Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can any One Tell which event ocur when selecting on dropdownlist item and changing form control means eg. when selecting one of the item in ddlist then one of the control in form is visible true or false...
Posted
Comments
[no name] 12-Oct-15 7:04am    
SelectedIndexChanged() is the method you are searching for.

 
Share this answer
 
XML
<asp:DropDownList ID="ddl" runat="server"  onselectedindexchanged="ddl_SelectedIndexChanged" AutoPostBack="true">
       </asp:DropDownList>


C#
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
   {
    if(ddl.SelectedItem.Text="Yes")
      {
        txt_box1.Visible=true;
      }
   }



Note:-Autopostback="true" is compulsary,

Go to design view of ur form double click on it,you get the selected index changes code block in code behind
 
Share this answer
 
v4
Comments
ASPDevloper 12-Oct-15 7:15am    
thnkx ...it will work...btw Autopostback="true" is missing ....
Arasappan 12-Oct-15 7:21am    
Thank You,AsPDevloper.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900