Hello,
I have a series of variables ending with a number and am trying (unsuccesfuly) to put them in a table using For Next loop.
the code looks like this:

<%
v1 =  "text_1"
v2 =  "text_2"
v3 =  "text_3"
%>
<table border="1">
<%
For x = 1 To 3
response.write("<tr ><td>text "&x&"</td><td>"&v+x&" </td></tr>")
next
%>
</table>

Any help much appreciated.

minbor

I do not really sure if this is what you want but in aspx i do this.

foreach (Control cd in form1.Controls)
            {
                if (cd.GetType().Name == "TextBox")
                {
                    TextBox txt = (TextBox)cd;
                    txt.Text = "hello";
                }
            }

regards

Hi
try this

<%
v1 =  "text_1"
v2 =  "text_2"
v3 =  "text_3"
%>
<table border="1">
<%
For x = 1 To 3

response.write("<tr ><td>text "&x&"</td><td>"& "v" & x &" </td></tr>")
next
%>

gavo0

Thanks for the replies but this does not exactly do whats needed. The result I'm looking for is a table like

____________
| v1 | text_1 |
| v2 | text_2 |
| v3 | text_3 |
-----------------

Thanks for the help

minbor

This question has already been answered. Start a new discussion instead.