Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Dynamic forms with input boxes added at run time.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arne Garvander - 05 Oct 2007 20:06 GMT
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?

Signature

Arne Garvander
Certified Geek
Professional Data Dude

Peter Bromberg [C# MVP] - 05 Oct 2007 20:26 GMT
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

> 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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.