I am sure that the answer to this is quite simple, but I am just not seeing it:
I have a number of text controls on a web page; for example:
Also, I note when I inspect the HTML of the page, that I am using ASP controls without them being surrounded by a <FORM> ... </FORM> tag pair. Is this the reason why I only get a value of 1 returned when I interrogate me.Controls.Count. Do I need these tags to do what I want to do, (or is it just good practice anyway).
Thanks in advance,
Steve Lewy
Solutions Developer
SimplyData
simplydata.com.au
(dont cut corners or you'll go round in circles)
I have a number of text controls on a web page; for example:
Whilst I can happily reference these individually; for example:<asp:TextBox ID="ETAC1" runat="server"></asp:TextBox>
<asp:TextBox ID="ETAC2" runat="server"></asp:TextBox>
<asp:TextBox ID="ETAC3" runat="server"></asp:TextBox>
<asp:TextBox ID="ETAC4" runat="server"></asp:TextBox>
I have not been able to figure how I can reference these controls programmatically. For example, I would like to do something like:ETAC1.Text = 10
ETAC2.Text = 20
ETAC3.Text = 30
ETAC4.Text = 40
Unfortunately I am unable to figure out the syntax for the above hilited row. Some help would really be appreciated.For i = 1 to 4
thisControlId = "ETAC" & i
Controls(ThisControlId).Text = i*10 ' <-----------
Next
Also, I note when I inspect the HTML of the page, that I am using ASP controls without them being surrounded by a <FORM> ... </FORM> tag pair. Is this the reason why I only get a value of 1 returned when I interrogate me.Controls.Count. Do I need these tags to do what I want to do, (or is it just good practice anyway).
Thanks in advance,
Steve Lewy
Solutions Developer
SimplyData
simplydata.com.au
(dont cut corners or you'll go round in circles)