Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a form with one dropdownlist,one textbox and one button . The textbox is filled based upon the dropdownlist value.There are many values in the dropdownlist and for each values i will give different values in the textbox.

What I need is that when the button is clicked the dropdownlist value and the corresponding textbox value should be added below to a label or anything.So whenever the button is clicked , both values should be added dynamically below the form to a new label or anything without affecting the previous added label .How can I do this .Since I am new to C# I don't have any idea about it.Any help will be really appreciated.Thanks in advance.

I know how to do it in gridview. But here the dropdownlist value is taken from a table field .So the dropdown values will change dynamically.

What I have tried:

I want the output as:

Dropdownvalue Textboxvalue

1.Name ABC
2.Product XXX
3.Price 0.00
4.Unit 3
Posted
Updated 23-Oct-17 2:26am
Comments
Richard MacCutchan 23-Oct-17 3:12am    
Why not just have a multi-line textbox and append the items each time they change?

You can programmatically add the controls(labels in your case) to your asp.net page on the click event of your button.

Take a look at this MSDN article to know how to do it.

Have a good day.
 
Share this answer
 
Actually you can be do this by using <asp:literal> control.
 
Share this answer
 

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