I am creating a textbox and button dynamically like this inside a FlowLayoutPanel:
Dim txtRating As New TextBox
txtRating.Name = "buildingRating_" + intCount.ToString
Dim btnAddRating As New Button
btnAddRating.Name = "addRating_" + intCount.ToString
And then I create an event handler for the button:
AddHandler btnAddRating.Click, AddressOf HandleAddRatingButtonClick
Each textbox and button will be associated with each other with the intCount value, so it would look like this:
buildingRating_1 addRating_1
buildingRating_2 addRating_2
buildingRating_3 addRating_3
etc....
I need to get the value of the textbox that is in associated with the button.
For example, if the user clicks the button named addRating_1, the text value of buildingRating_1 will be saved a database...
Is there a way to get that association or pass intCount into the btnAddRating.Click event that I am creating?
Thanks!
addRating_4c) create a user control that has both on it and encapsulates the dual nature c) create a look up list to get once from the other