Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > General ASP question

Reply
Thread Tools

General ASP question

 
 
Tom Edelbrok
Guest
Posts: n/a
 
      04-19-2006
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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      04-19-2006
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"


 
Reply With Quote
 
 
 
 
Guffa
Guest
Posts: n/a
 
      04-20-2006
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
General....very general.... no important for u forever hi Python 0 03-18-2009 08:21 AM
ASP.NET 2.0 Tree Control and Navigation Controls - General Question davidwank@gmail.com ASP .Net 2 04-13-2006 10:48 PM
General Design Question classic versus asp.net methodology needin4mation@gmail.com ASP .Net 3 07-25-2005 03:24 PM
General question about ASP .NET and HTML integration Baldy ASP .Net 1 10-17-2004 03:11 PM
general ASP.NET web programming question David ASP .Net 6 02-13-2004 05:33 PM



Advertisments