Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
commit Bug #82472 fix to the branch, as it seems that's where it shou…
…ld go

svn path=/branches/mono-1-2-5/mcs/; revision=84869
  • Loading branch information
grendello committed Aug 27, 2007
1 parent efba676 commit daba380
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 44 deletions.
5 changes: 5 additions & 0 deletions mcs/class/System.Web/System.Web.Configuration/ChangeLog
@@ -1,3 +1,8 @@
2007-08-10 Gert Driesen <drieseng@users.sourceforge.net>

* PagesConfigurationHandler.cs: Use enum for EnableSessionState.
* PagesConfiguration.cs: Use enum for EnableSessionState.

2007-05-01 Marek Habersack <mhabersack@novell.com>

* HttpCapabilitiesBase.cs: move the User-Agent code to a separate
Expand Down
Expand Up @@ -36,7 +36,7 @@ namespace System.Web.Configuration
class PagesConfiguration
{
internal bool Buffer = true;
internal string EnableSessionState = "true";
internal PagesEnableSessionState EnableSessionState = PagesEnableSessionState.True;
internal bool EnableViewState = true;
internal bool EnableViewStateMac = false;
internal bool SmartNavigation = false;
Expand Down
Expand Up @@ -48,11 +48,22 @@ public object Create (object parent, object configContext, XmlNode section)

attvalue = AttValue ("enableSessionState", section);
if (attvalue != null) {
if (attvalue != "true" && attvalue != "false" && attvalue != "ReadOnly")
switch (attvalue) {
case "true":
config.EnableSessionState = PagesEnableSessionState.True;
break;
case "ReadOnly":
config.EnableSessionState = PagesEnableSessionState.ReadOnly;
break;
case "false":
config.EnableSessionState = PagesEnableSessionState.False;
break;
default:
HandlersUtil.ThrowException ("The 'enableSessionState' attribute"
+ " is case sensitive and must be one of the following values:"
+ " false, true, ReadOnly.", section);
config.EnableSessionState = attvalue;
break;
}
}

attvalue = AttValue ("enableViewState", section);
Expand Down
4 changes: 4 additions & 0 deletions mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
@@ -1,3 +1,7 @@
2007-08-10 Gert Driesen <drieseng@users.sourceforge.net>

* PagesEnableSessionState.cs: Marked internal on 1.0 profile.

2007-07-16 Vladimir Krasnov <vladimirk@mainsoft.com>

* ProfileGroupSettingsCollection.cs: added ResetInternal internal
Expand Down
Expand Up @@ -28,14 +28,17 @@

using System.Resources;

#if NET_2_0
namespace System.Web.Configuration
{
public enum PagesEnableSessionState
{
False = 0,
ReadOnly = 1,
True = 2
}
}
#if NET_2_0
public
#else
internal
#endif
enum PagesEnableSessionState
{
False = 0,
ReadOnly = 1,
True = 2
}
}
16 changes: 15 additions & 1 deletion mcs/class/System.Web/System.Web.UI/ChangeLog
@@ -1,7 +1,21 @@
2007-08-10 Gert Driesen <drieseng@users.sourceforge.net>

* PageParser.cs: Replace enableSessionState and readOnlySessionState
bools with enum backed field. Move 1.0 profile code for checking value
of EnableSessionState pages config to PagesConfigurationHandler.
Fixes bug #82392 for 1.0 profile.

2007-08-09 Marek Habersack <mhabersack@novell.com>

* PageParser.cs: honor web.config enableSessionState
ReadOnly setting instead of overwriting based on default value for
page directive EnableSessionState. Patch from Joel Reed
<joelwreed@comcast.com>, thanks! Fixes bug #82392

2007-07-24 Igor Zelmanovich <igorz@mainsoft.com>

* ClientScriptManager.cs: fixed: GetCallbackEventReference method.

2007-07-23 Igor Zelmanovich <igorz@mainsoft.com>

* Page.cs: refactoring: __doPostBack client script
Expand Down
51 changes: 19 additions & 32 deletions mcs/class/System.Web/System.Web.UI/PageParser.cs
Expand Up @@ -43,14 +43,13 @@ namespace System.Web.UI
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class PageParser : TemplateControlParser
{
bool enableSessionState = true;
PagesEnableSessionState enableSessionState = PagesEnableSessionState.True;
bool enableViewStateMac = true;
bool smartNavigation = false;
bool smartNavigation;
bool haveTrace;
bool trace;
bool notBuffer;
TraceMode tracemode;
bool readonlySessionState;
string responseEncoding;
string contentType;
int codepage = -1;
Expand Down Expand Up @@ -112,24 +111,7 @@ internal override void LoadPagesConfigDefaults ()
#endif

notBuffer = !ps.Buffer;
#if NET_2_0
switch (ps.EnableSessionState) {
case PagesEnableSessionState.True:
case PagesEnableSessionState.ReadOnly:
enableSessionState = true;
break;

default:
enableSessionState = false;
break;
}
#else
if (String.Compare (ps.EnableSessionState, "true", true, CultureInfo.InvariantCulture) == 0)
enableSessionState = true;
else
enableSessionState = false;
#endif

enableSessionState = ps.EnableSessionState;
enableViewStateMac = ps.EnableViewStateMac;
smartNavigation = ps.SmartNavigation;
validateRequest = ps.ValidateRequest;
Expand Down Expand Up @@ -165,23 +147,23 @@ internal override void ProcessMainAttributes (Hashtable atts)
// note: the 'enableSessionState' configuration property is
// processed in a case-sensitive manner while the page-level
// attribute is processed case-insensitive
string enabless = GetString (atts, "EnableSessionState", enableSessionState.ToString ());
string enabless = GetString (atts, "EnableSessionState", null);
if (enabless != null) {
readonlySessionState = (String.Compare (enabless, "readonly", true) == 0);
if (readonlySessionState == true || String.Compare (enabless, "true", true) == 0) {
enableSessionState = true;
} else if (String.Compare (enabless, "false", true) == 0) {
enableSessionState = false;
} else {
if (String.Compare (enabless, "readonly", true) == 0)
enableSessionState = PagesEnableSessionState.ReadOnly;
else if (String.Compare (enabless, "true", true) == 0)
enableSessionState = PagesEnableSessionState.True;
else if (String.Compare (enabless, "false", true) == 0)
enableSessionState = PagesEnableSessionState.False;
else
ThrowParseException ("Invalid value for enableSessionState: " + enabless);
}
}

string cp = GetString (atts, "CodePage", null);
if (cp != null) {
if (responseEncoding != null)
ThrowParseException ("CodePage and ResponseEncoding are " +
"mutually exclusive.");
"mutually exclusive.");

int codepage = 0;
try {
Expand Down Expand Up @@ -436,7 +418,10 @@ protected override Type CompileIntoType ()
}

internal bool EnableSessionState {
get { return enableSessionState; }
get {
return enableSessionState == PagesEnableSessionState.True ||
ReadOnlySessionState;
}
}

internal bool EnableViewStateMac {
Expand All @@ -448,7 +433,9 @@ protected override Type CompileIntoType ()
}

internal bool ReadOnlySessionState {
get { return readonlySessionState; }
get {
return enableSessionState == PagesEnableSessionState.ReadOnly;
}
}

internal bool HaveTrace {
Expand Down

0 comments on commit daba380

Please sign in to comment.