Backport of r118813
authorMarek Habersack <grendel@twistedcode.net>
Fri, 14 Nov 2008 02:09:17 +0000 (02:09 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 14 Nov 2008 02:09:17 +0000 (02:09 -0000)
svn path=/branches/mono-2-2/mcs/; revision=118815

mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs

index fb6bdb35ef156c1ffebb0c195f00c3d0d199d2b3..4c9f6c5a88fb6fd6a79298dc978a028c6a36c58e 100644 (file)
@@ -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  <mhabersack@novell.com>
 
index 41b6a79408fc7782bc47576d0e59efa785b7e8a2..703be5eba3c6c78030f83fcf032b6bc47b3c46f8 100644 (file)
@@ -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.");