I am an ASP coder converting to C# and asp.net so pretty new to this (experience with c, c++ and java).
I built a template page with 12 labels formated in an html table. In my code page I want to loop thru thru these labels and add data from a database. I wont know exactly how much data there is so i have a next and prev button on the bottom to cycle thru the data.
i am using a foreach (control control in form1.controls) loop to loop thru the controls in my form. I check to see if control.id is equal to the string "label"+index (index is an int variable that i just increment). If I find the right label i want to add a string to that label (the string is basically some html with the db data... links, and image, and some text).
First off am i correct in using a label instead of a placeholder? I couldnt seem to get the string into the placeholder properly so that is why i use label.
Secondly how to assign the string to "found" label. I know the variable control probably holds the reference to the label but how do i set the text attribute = to my string?
This is probably pretty simple but time constrants and feature creep are driving me batty... ;)