Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "257966: Parameterless overload of WebPage::ExecutePageHierarc…

…hy throws"

Moving fix to next iteration.

This reverts commit a565f10.
  • Loading branch information...
commit 48e98c533c00dacd9fdc3db2ee86280a2f4ba5e4 1 parent a565f10
@pranavkm pranavkm authored
View
11 src/System.Web.WebPages/Resources/WebPageResources.Designer.cs
@@ -349,15 +349,6 @@ internal class WebPageResources {
}
/// <summary>
- /// Looks up a localized string similar to ExecutePageHierarchy cannot be invoked if PageContext is null..
- /// </summary>
- internal static string WebPage_ExecutePageHierarchyCannotBeInvoked {
- get {
- return ResourceManager.GetString("WebPage_ExecutePageHierarchyCannotBeInvoked", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to The following file could not be rendered because its extension &quot;{0}&quot; might not be supported: &quot;{1}&quot;..
/// </summary>
internal static string WebPage_FileNotSupported {
@@ -447,4 +438,4 @@ internal class WebPageResources {
}
}
}
-}
+}
View
3  src/System.Web.WebPages/Resources/WebPageResources.resx
@@ -216,9 +216,6 @@
<data name="WebPage_CannotRequestDirectly" xml:space="preserve">
<value>The file "{0}" cannot be requested directly because it calls the "{1}" method.</value>
</data>
- <data name="WebPage_ExecutePageHierarchyCannotBeInvoked" xml:space="preserve">
- <value>ExecutePageHierarchy cannot be invoked if PageContext is null.</value>
- </data>
<data name="WebPage_FileNotSupported" xml:space="preserve">
<value>The following file could not be rendered because its extension "{0}" might not be supported: "{1}".</value>
</data>
View
6 src/System.Web.WebPages/WebPage.cs
@@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Web.WebPages.Html;
-using System.Web.WebPages.Resources;
using System.Web.WebPages.Scope;
namespace System.Web.WebPages
@@ -66,11 +65,6 @@ public static void RegisterPageExecutor(IWebPageRequestExecutor executor)
public override void ExecutePageHierarchy()
{
- if (PageContext == null)
- {
- // The ExecutePageHierarchy in WebPageBase assumes a non-null PageContext.
- throw new InvalidOperationException(WebPageResources.WebPage_ExecutePageHierarchyCannotBeInvoked);
- }
using (ScopeStorage.CreateTransientScope(new ScopeStorageDictionary(ScopeStorage.CurrentScope, PageData)))
{
ExecutePageHierarchy(_executors);
View
10 test/System.Web.WebPages.Test/WebPage/WebPageTest.cs
@@ -32,16 +32,6 @@ public void CreatePageFromVirtualPathAssignsVirtualPathFactory()
}
[Fact]
- public void ExecutePageHierarchyThrowsIfPageContextIsNotSet()
- {
- // Arrange
- var page = new Mock<WebPage>() { CallBase = true };
-
- // Act and Assert
- Assert.Throws<InvalidOperationException>(() => page.Object.ExecutePageHierarchy(), "ExecutePageHierarchy cannot be invoked if PageContext is null.");
- }
-
- [Fact]
public void NormalizeLayoutPagePathTest()
{
var layoutPage = "Layout.cshtml";
Please sign in to comment.
Something went wrong with that request. Please try again.