Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 26th, 2007, 07:01 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic textbox creation

hi all,

ihave drop down with some number ..if user select the number like "5"
five text boxes has to get created ....and he will enter some data in the textboxes and the entered data i have to store into database on button click ..

this just like for ticket reservation for movies..etc ..

can any help ..thanks in advance


  #2 (permalink)  
Old July 26th, 2007, 10:40 AM
Friend of Wrox
 
Join Date: Feb 2006
Location: , , USA.
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There a lots of ways.

One way is that you could handle the drop down lists SelectedIndexChanged event, set the drop down to automatically post back, and then in the event handler create the selected number of text box's in a table and add the table to a place holder.

In the event handler the first thing you will need to do is cast the passed in sender object as a DropDownList in order to get the selected value, which will be an integer indicating the number of text box's to add into the form. From there it's a pretty simple loop that creates one new textbox with each iteration. You could stick each textbox into an html table and add that completed table to a placeholder on the web form.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic page creation DyerOppenheimer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 29th, 2009 05:34 PM
Dynamic creation of Columns in datagrid p330418 ASP.NET 2.0 Basics 0 March 29th, 2008 07:33 AM
Dynamic File name creation in subscription. bsuku BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 April 5th, 2005 03:41 PM
Dynamic creation of Web Pages vickyrawal ASP.NET 1.x and 2.0 Application Design 5 October 1st, 2003 08:28 AM
Dynamic Folder Creation ells228 Classic ASP Basics 0 August 7th, 2003 06:06 AM



All times are GMT -4. The time now is 06:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.