469,271 Members | 1,484 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

General ASP question

I'm reading the section "Postbacks and Round Trips" in the Visual Studio
2005 Help (I use VB.NET). Amongst other things, it says that as a result of
a postback "On the Web server, the page runs again. The information that the
user typed or selected is available to the page."

I can set this up in a test project and see that it occurs ... ie: my text
boxes retain their data (ie: "Hello world") even when a postback occurs on
the same or another server control.

If as a result of a postback the web page gets re-rendered at the server,
then how does the text in my textbox (or data in any other sort of server
control) get maintained? I would have thought that if the web-page gets
rebuilt from scratch, any data in controls would be lost.

Can someone explain how this works?

Thanks,

Tom Edelbrok
Apr 19 '06 #1
2 1245
Tom Edelbrok wrote:
I'm reading the section "Postbacks and Round Trips" in the Visual
Studio 2005 Help (I use VB.NET).
There was no way for you to know it (except maybe by browsing through some
of the previous questions before posting yours - always a recommended
practice), but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.
Amongst other things, it says that
as a result of a postback "On the Web server, the page runs again.
The information that the user typed or selected is available to the
page."
I can set this up in a test project and see that it occurs ... ie: my
text boxes retain their data (ie: "Hello world") even when a postback
occurs on the same or another server control.

If as a result of a postback the web page gets re-rendered at the
server, then how does the text in my textbox (or data in any other
sort of server control) get maintained? I would have thought that if
the web-page gets rebuilt from scratch, any data in controls would be
lost.

Look up ViewState in the online help.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Apr 19 '06 #2
> If as a result of a postback the web page gets re-rendered at the server,
then how does the text in my textbox (or data in any other sort of server
control) get maintained?


When the control is recreated it gets the value from the data sent from the
form.

Controls also store some stuff in ViewState to maintain it across postbacks.
Apr 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by JezB | last post: by
2 posts views Thread by ZorpiedoMan | last post: by
105 posts views Thread by Christoph Zwerschke | last post: by
1 post views Thread by Mark Fink | last post: by
3 posts views Thread by =?Utf-8?B?Ymxi?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.