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 February 22nd, 2012, 04:26 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default Chapter 4 - View State

Hi Imar,

I had a question on page 134. It says that you can turn off the View State at the web site level and Page level.

Should this affect code where the view state collection is being used to maintain the state? I tried turning this off at the web site and page levels and the state was still being maintained for the view state collection, but I just wanted to make sure.

Thank you.

Tulsi
 
Old February 22nd, 2012, 08:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
and the state was still being maintained for the view state collection
Which state are you referring to? Controls such as the TextBox maintain their state / value without ViewState as they submit their values to the server (through their HTML counterparts).

Cheers,

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!
 
Old February 23rd, 2012, 03:01 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

I was referring to the View State properties for User Controls. They use the view state collection to maintain the state across postbacks.

I was wondering if turning off view state and the site and page level (p.134) is supposed to affect the View State properties for User Controls.

Thank you for you help and always replying so quickly to emails.

Tulsi
 
Old February 25th, 2012, 07:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I was wondering if turning off view state and the site and page level (p.134) is supposed to affect the View State properties for User Controls.
Turning it off at the site level also turns it off at the UC level. Turning it off at the Page level does not affect the User Control.

Cheers,

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!
 
Old February 27th, 2012, 02:20 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

I'm a little confused... I set enableViewState="false" in the web.config file (site level), but the view state properties are still working for the user control. I am referring to the NavigateUrl property on p. 288.

Is there anything else I need to do to turn off view state at the site level?

Tulsi
 
Old February 28th, 2012, 03:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The NavigateUrl property maintains its state using ViewState as the property code explicitly targets ViewState. That works, regardless of the setting on the Site, Page or UC level.

Turning it off does have affect on other controls such as the GridView.

Cheers,

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:
Tulsi (February 28th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX and View State vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 1 February 22nd, 2012 02:09 PM
The View State Issue vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 2 January 27th, 2012 10:06 AM
View state problem rabbit3 ASP.NET 2.0 Professional 0 October 23rd, 2007 08:55 PM
Javascript and View State VictorVictor ASP.NET 2.0 Professional 8 April 2nd, 2007 02:34 PM
Session State|View State|Do I have other options? rockon ASP.NET 1.x and 2.0 Application Design 2 October 5th, 2005 07:10 PM





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