Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2010, 09:22 AM
Authorized User
 
Join Date: Jul 2010
Posts: 23
Thanks: 7
Thanked 2 Times in 1 Post
Default Postback and Stateview

Hello, first of all i would like to thank Imar for a awesome and very easy to read book.
It is probably the best book i have worked with.

I just read about postback and stateview in chapter 4, and i understand why it exists,
but i have some questions about what information is sent from the client to the server in a postback.

Are my following two statements correct?


- The stateview is only stored at the client and then sent with every postback,
is updated on the server if needed, and then sent back to the client.

- Everything inside <form> is sent to the server during a postback.

I probably dont need to know this in detail but i couldnt stop thinking about it
 
Old August 2nd, 2010, 09:37 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Are my following two statements correct?
More or less....
Quote:
The stateview is only stored at the client and then sent with every postback, is updated on the server if needed, and then sent back to the client.
Yes, ViewState is sent to the client when the page is done at the server. Whatever data is stored in ViewState is serialized (converted to characters basically so it can be stored in a hidden field) and sent back to the server after a postback. There it's used to recreate control state. When the page is sent to the client again, the new ViewState for that page is serialized and sent to the browser.
Quote:
Everything inside <form> is sent to the server during a postback.
Not everything; but controls that are designed to do this. E.g. the values of HTML controls such as <input type="text" />, <select />, <textarea /> and so are submitted to the server. Other elements, such as labels (<span /> elements) and text are not submitted to the server.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
andreas5 (August 2nd, 2010)
 
Old August 2nd, 2010, 10:13 AM
Authorized User
 
Join Date: Jul 2010
Posts: 23
Thanks: 7
Thanked 2 Times in 1 Post
Default

Alright, thanks!
 
Old August 6th, 2010, 09:50 AM
Authorized User
 
Join Date: Jul 2010
Posts: 81
Thanks: 10
Thanked 3 Times in 2 Posts
Default

I had to go over ViewState at least a couple of times. But I am beginning to understand, and I agree turn off ViewState except when you really need it.
__________________
Bob
bdtcomp.com
http://lettersfromasoldier.com
Follow me on Twitter
“Success is not final, failure is not fatal: it is the courage to continue that counts.”~Winston Churchill





Similar Threads
Thread Thread Starter Forum Replies Last Post
Postback grstad ASP.NET 2.0 Basics 3 June 13th, 2008 07:56 AM
postback events jgrant ASP.NET 2.0 Basics 1 September 5th, 2007 10:38 PM
postback sameer_1981 ASP.NET 1.0 and 1.1 Basics 1 February 23rd, 2007 09:36 AM
Postback raulsormus Classic ASP Basics 0 February 22nd, 2005 09:36 AM
Postback for usercontrols anuradha80 General .NET 4 September 27th, 2004 11:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.