Hello,
I want to know how to bind a table from my DB to a TextBox when I select a value from a dropdown list. FYI all my TextBox are created dynamically from another page (let us call it textboxcreate.aspx/.aspx.cs). So I do not create a TextBox from toolbox on this page and give it an asp ID. Rather, the TextBox is already created on another page and I dynamically bind the TextBox to the page we are on now (a separate page, let us call it populatetextbox.aspx/.aspx.cs).
Here is the scenario) There is a dropdown list and a TextBox. There are 3 items in ddl and they are, 0 - Select Below, 1 - Food, 2 - Drinks. When I select "Food" from the dropdown list, the TextBox should populate the word "Chicken" and when I select "Drinks" from the ddl, the TextBox should be populated w/"Drinks".
I believe the solution should be a method that has two parameters, an integer to reference the value selected from the ddl and another int that is the ID of the TextBox that is dynamically binded.
What would possible solutions look like?
What I have tried:
Please help! I have looked at close to 10 sources now on google and all the examples are creating textbox from the toolbox and getting that an asp ID then referencing that. Well yeah thats easy...but thats not the way to do it in my case. Also, many examples I found were an MVC approach, which again is not that way to do it in my case. Just ASP.NET.