2009-04-28 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Tue, 28 Apr 2009 08:39:43 +0000 (08:39 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Tue, 28 Apr 2009 08:39:43 +0000 (08:39 -0000)
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx

2009-04-28  Marek Habersack  <mhabersack@novell.com>

* TemplateControlCompilerTest.cs: added test for bug #498637

2009-04-28  Marek Habersack  <mhabersack@novell.com>

* AspGenerator.cs: ProcessTag doesn't process a tag which is not
server-side and which has declarative expressions embedded. Fixes
bug #498637

2009-04-28  Marek Habersack  <mhabersack@novell.com>

* NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx: added

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

mcs/class/System.Web/ChangeLog
mcs/class/System.Web/Makefile
mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs
mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog
mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
mcs/class/System.Web/Test/mainsoft/ChangeLog
mcs/class/System.Web/Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx [new file with mode: 0644]

index 448b0c0f76adec829f90b65304f086105a9082ec..add923a96c7b55a0b4d32aa57e01c6c343d2c719 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-28  Marek Habersack  <mhabersack@novell.com>
+
+       * Makefile (TEST_RESOURCE_FILES): added
+       Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx
+
 2009-04-24  Marek Habersack  <mhabersack@novell.com>
 
        * System.Web_test.dll.sources: added
index 85e430e145ab455049da93a880b128900e236c1b..db52132f80b977f2d580fd210b0df486752844f1 100644 (file)
@@ -166,7 +166,8 @@ TEST_RESOURCE_FILES = \
        Test/mainsoft/NunitWebResources/NoDoubleOnInitOnRemoveAdd.aspx \
        Test/mainsoft/NunitWebResources/NoDoubleOnInitOnRemoveAdd.aspx.cs \
        Test/mainsoft/NunitWebResources/LoginDisplayRememberMe.aspx \
-       Test/mainsoft/NunitWebResources/NoBindForMethodsWithBindInName.aspx
+       Test/mainsoft/NunitWebResources/NoBindForMethodsWithBindInName.aspx \
+       Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx
 
 RESX_DIST =  resources/TranslationResources.resx
 ifeq (net_2_0, $(PROFILE))
index e632c49e47bfa1ced1905f0be39374a12c5f6968..ad1f6b6f9339471d064181bf5e1cf663f9fe14fa 100644 (file)
@@ -806,7 +806,8 @@ namespace System.Web.Compilation
                                }
                        }
 
-                       if (builder == null && atts != null && atts.IsRunAtServer ()) {
+                       bool runatServer = atts != null && atts.IsRunAtServer ();
+                       if (builder == null && runatServer) {
                                string id = htable ["id"] as string;
                                if (id != null && !CodeGenerator.IsValidLanguageIndependentIdentifier (id))
                                        throw new ParseException (Location, "'" + id + "' is not a valid identifier");
@@ -823,6 +824,8 @@ namespace System.Web.Compilation
                        if (builder == null)
                                return false;
 
+                       if (!runatServer && location.PlainText.IndexOf ("<%") > -1)
+                               return false;
 #if NET_2_0
                        PageParserFilter pfilter = PageParserFilter;
                        if (pfilter != null && !pfilter.AllowControl (builder.ControlType, builder))
index 14f53c910507e2a092604da7d861825a7e883e35..a507ee65b7ea716e76d0b6e647e509358422dcec 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-28  Marek Habersack  <mhabersack@novell.com>
+
+       * AspGenerator.cs: ProcessTag doesn't process a tag which is not
+       server-side and which has declarative expressions embedded. Fixes
+       bug #498637
+
 2009-04-24  Marek Habersack  <mhabersack@novell.com>
 
        * AspGenerator.cs: ProcessCode should _not_ stop processing the
index 521060ee4fc422f73176c72b9849eb646a5a5c5c..f6bd1ed9c4344a2c43aca4b8dd6ed6e1cd836a7b 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-28  Marek Habersack  <mhabersack@novell.com>
+
+       * TemplateControlCompilerTest.cs: added test for bug #498637
+
 2009-04-16  Marek Habersack  <mhabersack@novell.com>
 
        * TemplateControlCompilerTest.cs: added test for bug #493639
index 0c241da45940f14d96531f52cd712173193378b2..b7ae0e43b3495accf6919609b0c462d3276167ef 100644 (file)
@@ -67,6 +67,7 @@ namespace MonoTests.System.Web.Compilation {
                        WebTest.CopyResource (GetType (), "ReadWritePropertyControl.ascx", "ReadWritePropertyControl.ascx");
                        WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.aspx", "ContentPlaceHolderInTemplate.aspx");
                        WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.master", "ContentPlaceHolderInTemplate.master");
+                       WebTest.CopyResource (GetType (), "LinkInHeadWithEmbeddedExpression.aspx", "LinkInHeadWithEmbeddedExpression.aspx");
 #endif
                }
                
@@ -156,6 +157,17 @@ namespace MonoTests.System.Web.Compilation {
                        
                        HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
                }
+
+               // bug #498637
+               [Test]
+               public void LinkInHeadWithEmbeddedExpression ()
+               {
+                       string pageHtml = new WebTest ("LinkInHeadWithEmbeddedExpression.aspx").Run ();
+                       string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+                       string originalHtml = "<link href=\"Themes/Default/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" />";
+
+                       HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+               }
 #endif
                
                [Test]
index a11ca308e6997be67676c422d587f4b427f45969..5b333cd8c095e18d49731ed7d1b5be7597fe2671 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-28  Marek Habersack  <mhabersack@novell.com>
+
+       * NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx: added
+
 2009-02-05  Marek Habersack  <mhabersack@novell.com>
 
        * NunitWebResources/NoDoubleOnInitOnRemoveAdd.aspx,
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/LinkInHeadWithEmbeddedExpression.aspx
new file mode 100644 (file)
index 0000000..d0c109c
--- /dev/null
@@ -0,0 +1,8 @@
+<%@ Page Language="C#" %>
+<html>
+<head runat="server"><title>Bug #498637</title>
+<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><link href="<%= Page.ResolveClientUrl("~/Themes/Default/Content/Site.css") %>" rel="stylesheet" type="text/css" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+</head>
+<body>
+</body>
+</html>