Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


dynamic textbox

Posted on 2011-02-11
Medium Priority
Last Modified: 2012-08-14
i cant create dynamic textboxes with html commands.
How do i do this?

 For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
            strResults.Append("<input type=text value=" & ds.Tables(0).Rows(i).Item(8) & "/>")
            strResults.Append(" <asp:TextBox  ></asp:TextBox>")
Question by:jagguy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Expert Comment

by:Praveen Kumar
ID: 34870359
You have to provide name attribute for it:

 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
LVL 11

Accepted Solution

SAMIR BHOGAYTA earned 2000 total points
ID: 34870394
Hi, use this code

//On Button Click
TextBox txt = new TextBox();
txt.Name = "a1" + i.ToString();

txt.Location = new Point(367, y);
txt.Size = new Size(127, 20);
TextBox txt1 = new TextBox();
txt1.Name = "a2" + i.ToString();

txt1.Location = new Point(520, y);
txt1.Size = new Size(59,20);

TextBox txt2 = new TextBox();
txt2.Name = "a3" + i.ToString();

txt2.Location = new Point(602, y);
txt2.Size = new Size(59,20);
y += 25;

//To Retrive TexBoxes

for(int p=0; p
foreach (Control tempc in panel2.Controls)
if(tempc is TextBox)
if (tempc.Name == "a1"+ p.ToString())
medicine = tempc.Text;
else if (tempc.Name == "a2" +p.ToString())
time = tempc.Text;
else if (tempc.Name == "a3" + p.ToString())
day = tempc.Text;
obj.insertdata("INSERT INTO.... ");

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question