Просмотр исходного кода

2008-11-14 Marek Habersack <[email protected]>

	* TemplateControlCompiler.cs: If BindingDirection of the parent 
        template builder is OneWay in
	RegisterBindingInfo, do not throw an exception but simply do not
	register the binding.

svn path=/trunk/mcs/; revision=118813
Marek Habersack 17 лет назад
Родитель
Сommit
4f2fbd7c2b

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

@@ -4,6 +4,9 @@
 	verbatim code. The only difference between the two is that in the
 	latter case Bind is replaced with Eval in the output code. Fixes
 	bug #444725
+	If BindingDirection of the parent template builder is OneWay in
+	RegisterBindingInfo, do not throw an exception but simply do not
+	register the binding.
 
 2008-10-29  Marek Habersack  <[email protected]>
 

+ 6 - 2
mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs

@@ -602,9 +602,13 @@ namespace System.Web.Compilation
 				if (match.Success) {
 					string bindingName = match.Groups [1].Value;
 					TemplateBuilder templateBuilder = builder.ParentTemplateBuilder;
-					if (templateBuilder == null || templateBuilder.BindingDirection == BindingDirection.OneWay)
+					
+					if (templateBuilder == null)
 						throw new HttpException ("Bind expression not allowed in this context.");
-						
+
+					if (templateBuilder.BindingDirection == BindingDirection.OneWay)
+						return;
+					
 					string id = builder.attribs ["ID"] as string;
 					if (id == null)
 						throw new HttpException ("Control of type '" + builder.ControlType + "' using two-way binding on property '" + propName + "' must have an ID.");