473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dynamic forms with input boxes added at run time.

I am programming input forms in Asp.net 2.0
Some textboxes are static on the form and viewstate works fine.
Some textboxes have to be dynamically added to the form at run-time which
makes viewstate difficult to maintain. Sometimes I have got viewstate to
magically work. Sometime I have to manually restore viewstate.
What is the best way to deal with dynamically created input boxes?

--
Arne Garvander
Certified Geek
Professional Data Dude
Oct 5 '07 #1
1 1300
Whenever a page posts back, you must recreate any dynamically added controls
and ensure they have the same ID property they had when you first created
them.
Setting EnableViewState to true helps too.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Arne Garvander" wrote:
I am programming input forms in Asp.net 2.0
Some textboxes are static on the form and viewstate works fine.
Some textboxes have to be dynamically added to the form at run-time which
makes viewstate difficult to maintain. Sometimes I have got viewstate to
magically work. Sometime I have to manually restore viewstate.
What is the best way to deal with dynamically created input boxes?

--
Arne Garvander
Certified Geek
Professional Data Dude
Oct 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: guy | last post by:
Has anyone any experience of building a form at run time? I have an app that will require 50+ simple forms, it will only be used by me, so appearance isnt important. My idea is to pass a...
7
by: pizzy | last post by:
PROBLEM: I CAN'T GET THE LAST RESUTS TO WORK CORRECTLY. I WOULD PROVIDE THE CODE (AND WILL IF REQUESTED). BUT IN MY OWN WORDS I AM TRYING TO HAVE THE FIRST FORM DYNAMICALLY CREATE INPUT BOXES...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
5
by: Nate | last post by:
Good Morning All, What we have is a dynamic business object that has varying numbers and types of properties. What it models is a generic saleable product. Not all products have the same...
4
by: jedimasta | last post by:
Good evening all, I'm a relatively new to javascript, but I've been working with ColdFusion and PHP for years so I'm not necessarily ignorant, just stuck and frustrated. Using ColdFusion I'm...
5
by: Nitestarz | last post by:
The following will add an input box on submit everytime a button is clicked. I would like it so that it names the input box differently everytime it is added starting with the number2, for example...
4
by: sidesteal | last post by:
PLEASE forgive me! I have been a web designer for a few years now, and want to move on and learn a programming language. Im currently building a website, and i have a js file that contains some...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.