dynamically creating textboxes

Posted on 2005-04-14
Last Modified: 2010-04-07
i need  sample code for creating textboxs dynamically

i am using following code
but this will create only one textbox!

 Dim tb As New TextBox

Question by:Basic
    LVL 7

    Expert Comment

    is there a reason why you can't create multiple textboxes dynamically and add 'em into your placeHolder?

    dim tb1 as New TextBox
    dim tb2 as New TextBox

    tb1.Style["Position"] = "Absolute";
    tb1.Style["left"] = "175px";
    tb1.Style["top"] = "200px"

    //do same for tb2


    to specify the location of your newly created textboxes, you'd set the style property of your textboxes.

    at least it works like that in C#, not so sure about but I'd imagine syntax very similiar.

    LVL 6

    Expert Comment

    Er, so create a loop...

    For ...
         Dim tb As New TextBox


    While ...
         Dim tb As New TextBox
    End While


    Author Comment


    i want each time i click a button
    a new textbox will add to the placeholder

    and please tell me how to get values of those textboxes
    LVL 20

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now