+2008-01-08 Marek Habersack <mhabersack@novell.com>
+
+ * TemplateControlCompiler.cs: statements to assign
+ fields/properties from resources must be processed at the very end
+ of the control creation method. Some controls (like HyperLink) can
+ set their Text attribute using literal content. In such cases, in
+ order to properly localize the control, the value read from the
+ local page resources must be assigned after the literal value has
+ been added to the control. Fixes bug #323494
+
2008-01-07 Marek Habersack <mhabersack@novell.com>
* CachingCompiler.cs: added an overload to the Compile method
protected void CreateAssignStatementsFromAttributes (ControlBuilder builder)
{
-#if NET_2_0
- bool haveMetaKey = false;
-#endif
this.dataBoundAtts = 0;
IDictionary atts = builder.attribs;
if (atts == null || atts.Count == 0)
/* we skip SkinID here as it's assigned in BuildControlTree */
if (InvariantCompareNoCase (id, "skinid"))
continue;
- if (InvariantCompareNoCase (id, "meta:resourcekey")) {
- haveMetaKey = true;
- continue;
- }
+ if (InvariantCompareNoCase (id, "meta:resourcekey"))
+ continue; // ignore, this one's processed at the very end of
+ // the method
#endif
CreateAssignStatementFromAttribute (builder, id);
}
-
-#if NET_2_0
- if (haveMetaKey)
- CreateAssignStatementFromAttribute (builder, "meta:resourcekey");
-#endif
}
void CreateDBAttributeMethod (ControlBuilder builder, string attr, string code)
builder.methodStatements.Add (invoke);
}
-
- if (!childrenAsProperties && typeof (Control).IsAssignableFrom (builder.ControlType))
- builder.method.Statements.Add (new CodeMethodReturnStatement (ctrlVar));
#if NET_2_0
if (builder is RootBuilder)
if (!String.IsNullOrEmpty (parser.MetaResourceKey))
AssignPropertiesFromResources (builder, parser.BaseType, parser.MetaResourceKey);
+
+ if ((!isTemplate || builder is RootBuilder) && builder.attribs != null && builder.attribs ["meta:resourcekey"] != null)
+ CreateAssignStatementFromAttribute (builder, "meta:resourcekey");
#endif
+
+ if (!childrenAsProperties && typeof (Control).IsAssignableFrom (builder.ControlType))
+ builder.method.Statements.Add (new CodeMethodReturnStatement (ctrlVar));
}
protected internal override void CreateMethods ()