By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Dynamically HOW TO ADD TEXT BOXS in ASP.NET Using VB Coding??

P: 10
Dear friends,

I have to create a webpage where in it ask the user to enter a number.

when the user enters a number and clicks Submit button, then page should display that number of text boxes.

for example if user enters number 5 then the page should display 5 text boxes in different line next to other.

Waiting for your replys..
Thanks,
Kapil.
Apr 27 '07 #1
Share this Question
Share on Google+
1 Reply


dip_developer
Expert 100+
P: 648
Dear friends,

I have to create a webpage where in it ask the user to enter a number.

when the user enters a number and clicks Submit button, then page should display that number of text boxes.

for example if user enters number 5 then the page should display 5 text boxes in different line next to other.

Waiting for your replys..
Thanks,
Kapil.

Take a PlaceHolder control...Add textbox at runtime with the following code(Code is in VB.net). You have to set the width/height of dynamically created textbox on your own

Expand|Select|Wrap|Line Numbers
  1. Dim tb as TextBox
  2. Dim n As Integer = Val(myTextbox.Text)
  3.  
  4.  For i As Integer = 0 To n - 1
  5.             tb = New TextBox
  6.            PlaceHolder1.Controls.Add(tb)
  7.         Next
Apr 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.