2007-09-04 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Tue, 4 Sep 2007 12:03:37 +0000 (12:03 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Tue, 4 Sep 2007 12:03:37 +0000 (12:03 -0000)
            When generating code for a property or field, use the name
            retrieved from the metadata by reflection instead of the one
            parsed from html. Fixes bug #82687. Patch from SunHo Kim
            <zsunno@gmail.com>, thanks

svn path=/trunk/mcs/; revision=85269

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

index a70dc72e42d4f2cdb01626f2537c6b76c526847a..0ea346c59c21d79d4709a45de183f2f90beb15a4 100644 (file)
@@ -3,6 +3,10 @@
        * TemplateControlCompiler.cs: make sure that base class doesn't
        contain a field of the same name which is accessible from the
        current control if we're within a singleton template.
+       When generating code for a property or field, use the name
+       retrieved from the metadata by reflection instead of the one
+       parsed from html. Fixes bug #82687. Patch from SunHo Kim
+       <zsunno@gmail.com>, thanks!
 
 2007-08-29  Marek Habersack  <mhabersack@novell.com>
 
index 5dd0824fd4d426c7cdd173bc41ddb1ec40e8f7c4..acfc8b7addd238280991e7f394abfb81cebdd7fa 100644 (file)
@@ -616,6 +616,7 @@ namespace System.Web.Compilation
                        string prop_field = id.Replace ("-", ".");
                        string [] parts = prop_field.Split (new char [] {'.'});
                        int length = parts.Length;
+                       
                        if (length < 2 || !InvariantCompareNoCase (member.Name, parts [0]))
                                return false;
 
@@ -624,7 +625,7 @@ namespace System.Web.Compilation
                                if (sub_member == null)
                                        return false;
 
-                               string new_prefix = prefix + parts [0] + ".";
+                               string new_prefix = prefix + member.Name + ".";
                                string new_id = id.Substring (hyphen + 1);
                                return ProcessPropertiesAndFields (builder, sub_member, new_id, attValue, new_prefix);
                        }