Postback and asp:table

M

Maria

Hi

I have a asp:table that I want to hold the values between
postbacks. Hope some one knows how I can get that to work
in an easy way. The table is loaded in runtime with
different textboxes. When i press a button and runs some
server code the page becomes "quite empty"

Thanks in advance

Maria
 
T

Tammy

question: are you using "<input type='text'>" or "<asp:textbox id='txt1'
runat='server'>"

if i'm not mistaken, the asp textbox have viewstate enabled by default.
they should re-populate data on postbacks.
 
H

Hermit Dave

Hey,

Remember reading about this a while back but if you are adding controls
dynamically to your grid.... postback wont get 'em back. I suggest you read
up some tutorials on http://www.asp.net/Tutorials/quickstart.aspx

and check up on customer server controls.... framework.aspnet.webcontrols
newsgroup might be a good place to start as well...

Regards,
HD
 
H

Hermit Dave

meant custom server controls

a few lines from one of the articles at
http://www.dotnetjunkies.com/quickstart/aspplus/doc/webctrlauthoring.aspx

Maintaining State
Every Web Forms control has a ViewState property (inherited from Control)
that enables it to participate in ViewState management. The type of
ViewState is Sytem.Web.UI.StateBag, which is a data structure equivalent to
a hashtable. A control can save data in ViewState as key/value pairs.
ViewState is persisted to a string variable by the ASP.NET page framework
and makes a round trip to the client as a hidden variable. Upon postback,
the page framework parses the input string from the hidden variable and
populates the ViewState property of each control in the control hierarchy of
a page. A control can restore its state (set properties and fields to their
values before postback) using the ViewState property. Control developers
should be aware that there is a performance overhead in sending data by
round trip to the client, and be judicious about what they save in
ViewState.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top