From: Marek Habersack Date: Fri, 14 Nov 2008 02:09:17 +0000 (-0000) Subject: Backport of r118813 X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=7a9e96f1669c38f4acff38cabdf14756429c470c;p=mono.git Backport of r118813 svn path=/branches/mono-2-2/mcs/; revision=118815 --- diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog index fb6bdb35ef1..4c9f6c5a88f 100644 --- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog +++ b/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 diff --git a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs index 41b6a79408f..703be5eba3c 100644 --- a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs +++ b/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.");