Author: mhabersack
Date: 2007-09-05 18:12:40 -0400 (Wed, 05 Sep 2007)
New Revision: 85386
Modified:
trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
Log:
2007-09-06 Marek Habersack <[EMAIL PROTECTED]>
* TemplateControlCompiler.cs: ID must be assigned as soon as
possible, before any other attributes of the control are
accessed. The control code may rely on ID being set.
Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-09-05
21:33:19 UTC (rev 85385)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-09-05
22:12:40 UTC (rev 85386)
@@ -1,3 +1,9 @@
+2007-09-06 Marek Habersack <[EMAIL PROTECTED]>
+
+ * TemplateControlCompiler.cs: ID must be assigned as soon as
+ possible, before any other attributes of the control are
+ accessed. The control code may rely on ID being set.
+
2007-09-05 Marek Habersack <[EMAIL PROTECTED]>
* ThemeDirectoryCompiler.cs: all the skin files compiled in one
Modified:
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
2007-09-05 21:33:19 UTC (rev 85385)
+++
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
2007-09-05 22:12:40 UTC (rev 85386)
@@ -295,6 +295,14 @@
}
#endif
+ // process ID here. It should be set before any
other attributes are
+ // assigned, since the control code may rely on
ID being set. We
+ // skip ID in
CreateAssignStatementsFromAttributes
+ if (builder.attribs != null) {
+ string ctl_id = builder.attribs ["id"]
as string;
+ if (ctl_id != null && ctl_id !=
String.Empty)
+
CreateAssignStatementFromAttribute (builder, "id");
+ }
#if NET_2_0
if (typeof
(ContentPlaceHolder).IsAssignableFrom (type)) {
CodePropertyReferenceExpression prop =
new CodePropertyReferenceExpression (thisRef, "ContentPlaceHolders");
@@ -890,7 +898,10 @@
foreach (string id in atts.Keys) {
if (InvariantCompareNoCase (id, "runat"))
continue;
-
+ // ID is assigned in BuildControltree
+ if (InvariantCompareNoCase (id, "id"))
+ continue;
+
#if NET_2_0
/* we skip SkinID here as it's assigned in
BuildControlTree */
if (InvariantCompareNoCase (id, "skinid"))
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches