Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 26th, 2007, 07:01 AM
Registered User
Join Date: Jun 2007
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

Old July 26th, 2007, 10:40 AM
Friend of Wrox
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts

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.

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

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