Prechádzať zdrojové kódy

2006-09-18 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.UI/PageParser.cs:
	* System.Web.Compilation/PageCompiler.cs: support the
	EnableEventValidation attribute.


svn path=/trunk/mcs/; revision=65610
Gonzalo Paniagua Javier 19 rokov pred
rodič
commit
aeae1b7019

+ 4 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,7 @@
+2006-09-18 Gonzalo Paniagua Javier <[email protected]>
+
+	* PageCompiler.cs: support the EnableEventValidation attribute.
+
 2006-09-08 Gonzalo Paniagua Javier <[email protected]>
 
 	* AspGenerator.cs: after parsing an include file, don't error out if we

+ 10 - 0
mcs/class/System.Web/System.Web.Compilation/PageCompiler.cs

@@ -195,6 +195,16 @@ namespace System.Web.Compilation
 				method.Statements.Add (expr);
 			}
 #endif
+#if NET_2_0
+			if (!pageParser.EnableEventValidation) {
+                                CodeAssignStatement stmt = new CodeAssignStatement ();
+                                CodePropertyReferenceExpression prop;
+                                prop = new CodePropertyReferenceExpression (thisRef, "EnableEventValidation");
+				stmt.Left = prop;
+				stmt.Right = new CodePrimitiveExpression (pageParser.EnableEventValidation);
+				method.Statements.Add (stmt);
+			}
+#endif
                         
 			base.AppendStatementsToFrameworkInitialize (method);
 		}

+ 4 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,7 @@
+2006-09-18 Gonzalo Paniagua Javier <[email protected]>
+
+	* PageParser.cs: support the EnableEventValidation attribute.
+
 2006-09-18 Igor Zelmanovich <[email protected]>
 
 	* Page.cs: fixed: Title property works properly

+ 6 - 0
mcs/class/System.Web/System.Web.UI/PageParser.cs

@@ -66,6 +66,7 @@ namespace System.Web.UI
 		string title;
 		string theme;
 		string styleSheetTheme;
+		bool enable_event_validation;
 #endif
 
 		public PageParser ()
@@ -286,6 +287,7 @@ namespace System.Web.UI
 
 			theme = GetString (atts, "Theme", null);
 			styleSheetTheme = GetString (atts, "StyleSheetTheme", null);
+			enable_event_validation = GetBool (atts, "EnableEventValidation", true);
 #endif
 			// Ignored by now
 			GetString (atts, "EnableViewStateMac", null);
@@ -425,6 +427,10 @@ namespace System.Web.UI
 		internal string Title {
 			get { return title; }
 		}
+
+		internal bool EnableEventValidation {
+			get { return enable_event_validation; }
+		}
 #endif
 	}
 }