Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to display text message in a textbox which should be associated with a value selected from dropdown list.
how can I achieve this???
Posted
Updated 10-Jan-12 19:23pm
v2
Comments
Rajesh Anuhya 11-Jan-12 1:27am    
No Effort
sriman.ch 11-Jan-12 1:43am    
Before asking a question atleat try to do something on your own or try googling. It will helps you...

hello ayush,

just work on selected index change event of dropdown list.
C#
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
    {
textbox1.Text=ddl1.SelectedItem.ToString(); // show text of dropdownlist
textbox1.Text=ddl1.SelectedValue.ToString(); // show value of dropdownlist

}

this type of answer you can find easily so before posting a question you should go for search.
Hope this will help you.
And don't forget to mark as answer if it helps. :)
 
Share this answer
 
Use,

Textbox1.Text=dropdownlist1.SelectedItem.Text;
 
Share this answer
 
v2

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