Embeded Tables

B

barry

Hi there

I create a table with the following code

string strDLName = "Hello";

Response.Write("<Table id='ManageDlTable'>");

for(int i = 0; i < 6; i++)

{

Response.Write("<Tr>");

for(int j = 0; j < 5; j++)

{

Response.Write("<Td>");

Response.Write("<INPUT type='TEXT' size='10' value='" + strDLName + "-" +
i.ToString() + "." + j.ToString() + "'>");

Response.Write("</Td>");

}

Response.Write("</Tr>");

}

Response.Write("</Table>");



There is a Button on the page, when i click on the button i want to know the
value of one of the above created Input box , how do i achive this

Barry
 
A

Andrea Zani

barry said:
There is a Button on the page, when i click on the button i want to
know the value of one of the above created Input box , how do i
achive this

Barry

Add the attribute name:
Response.Write("<INPUT type='TEXT' size='10' value='" + strDLName + "-" +
i.ToString() + "." + j.ToString() + "' name='txt'>");

And after postback:
string value=Request["txt"].ToString();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top