473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

enableviewstate override not working in web.config

I have a Web.config in my application root dir with the following pages
directive:

<pages buffer="true"
enableViewState="false" enableSessionState="false"
enableViewStateMac="false"/>

And then one in a subdirectory with this one (viewstate enabled):

<pages buffer="true"
enableViewState="true" enableSessionState="false"
enableViewStateMac="true"/>

View state does NOT get enabled in the subdirectory. If I change the pages
directive in the root dir, ViewState goes on. Otherwise, it doesn't. I
can't imagine how this isn't a bug... Any ideas?

As a possible aside, the page in the subdir uses a control, that is also in
the subdir. I put a check in the controls Page_Load of the control to check
ViewState. It thinks it's on.

if (Page.EnableViewState == false || this.EnableViewState == false)
{
Response.Write("Cannot run without view state");
Response.End();
}
Thanks
--max


Nov 18 '05 #1
7 2992
Hi Max,

As for the problem( <pages enableViewState="true|false" /> can't be
override via web.config in sub dir), I've also done some tests on my side
and did encounter the same problem. And currently I'm consulting some
further experts to confirm whether this is a known issue of the asp.net
configuration and will give a update soon. Also, I think as for such
problem on specifying a override configure schema for asp.net sub dir , we
can use the <location> element in the root web.config file instead of
puting a separate one in sub dir. Here are some reference on applying the
<locaiton> elemtn to implement hierarchy configuration in asp.net app:

#<location> Element
http://msdn.microsoft.com/library/en...ationElement.a
sp?frame=true

#Configuration <location> Settings
http://msdn.microsoft.com/library/en...igurationlocat
ionsettings.asp?frame=true

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Thanks for the reply. It looks as if doing it in a location directive
doesn't work either. Same behavior, it says it's working (the page thinks
viewstate is on), but it's all a big lie. :)

--Max

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:q9*************@cpmsftngxa10.phx.gbl...
Hi Max,

As for the problem( <pages enableViewState="true|false" /> can't be
override via web.config in sub dir), I've also done some tests on my side
and did encounter the same problem. And currently I'm consulting some
further experts to confirm whether this is a known issue of the asp.net
configuration and will give a update soon. Also, I think as for such
problem on specifying a override configure schema for asp.net sub dir , we
can use the <location> element in the root web.config file instead of
puting a separate one in sub dir. Here are some reference on applying the
<locaiton> elemtn to implement hierarchy configuration in asp.net app:

#<location> Element
http://msdn.microsoft.com/library/en...ationElement.a sp?frame=true

#Configuration <location> Settings
http://msdn.microsoft.com/library/en...igurationlocat ionsettings.asp?frame=true

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
Hi Max,

Thanks for the followup. I'm still consulting some further experts on this
issue. I'll update you as soon as I've got any new infos. Thanks for your
understanding.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #4
Hi Max,

It seems a bit strange, I've try set the sub dir ( in IIS manage console )
as an application and then set it back to a normal dir and restart the IIS
server, after that , all is working well. The web.config in the sub dir's
setting can override the root web.config file's setting. Would you please
also have a try on this.
You can make the sub dir as an application virutal dir and test again.
Then, reset it back to a normal dir and test to see whether this helps.
Currently on my side, the enableViewState override works well.
If you have any new findings or question, please feel free to post here.
Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5
Hi Max,

Have you got any further ideas on this issue? If you have anything unclear
or if there're anything else we can help, please feel free to post here.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
My not-so-fun-but-no-so-hard solution was just to mark enableviewstate=false
everywhere, in all controls and pages, and the remove it from web.config.
Then I can turn it on selectively.

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:3S**************@cpmsftngxa10.phx.gbl...
Hi Max,

Have you got any further ideas on this issue? If you have anything unclear
or if there're anything else we can help, please feel free to post here.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #7
Hi Max,

You mean the setting in sub folder's web.config file still not working on
your side? Have you tried the means mentioned in my last reply? Or you can
try this on another machine to see whether it work. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dave Verwer | last post by:
Hi I have a problem which is easily reproducable using VS.NET 2003 and the .Net framework 1.1 (not tested with framework 1.0) regarding disabling ViewState for dynamically created controls. ...
1
by: Ravikanth[MVP] | last post by:
Hi Even though the Viewstate has been disabled, ASP.NET still uses about twenty bytes for Viewstate. Not only can you disable Viewstate at the page level, but you can also disable Viewstate...
4
by: Bruce Chao | last post by:
I tried to turn off viewstate and so I added enableViewState=false in side the Page directive, rebuild the page, test it. - not working Then I set all controls on the page so all their...
7
by: Brian Henry | last post by:
Hi, I want EnableViewState = false turned on to optimize the end output page (it was over 600KB with it on) but when i turn it off, our pageing functionality no longer works mainly the...
0
by: Michael Baker | last post by:
Overriding the view state in web.config for various locations never worked for me before. However, i just tested it on my machine after the 1.1 sp1 framework upgrade and it appears to work now. I...
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
7
by: Just D. | last post by:
Does anybody know any good solution to avoid this setting to be enabled? I guess Microsoft doesn't care of the Internet connection of the potential client working with asp.net. This EnableViewState...
3
by: | last post by:
Here is an interesting one. If I disable viewstate in the web.config file, but enable it on a specific page, it doesnt save the viewstate on postbacks. I have to actually enable it in web.config. ...
6
by: John H Clark | last post by:
I am designing a site that requires AnonymousID. I set my web.config to allow this using <anonymousIdentification enable="true".../as recommended in the documentation. To verify the settings I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.