This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding IView.Path and ViewContext.ExecutingPagePath
Fixes #1940
- Loading branch information
Showing
16 changed files
with
239 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...soft.AspNet.Mvc.FunctionalTests/Compiler/Resources/ViewEngineController.ViewWithPaths.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Layout> | ||
/Views/ViewWithPaths/_Layout.cshtml | ||
/Views/ViewWithPaths/Index.cshtml | ||
</Layout> | ||
|
||
<ViewStart> | ||
Views\ViewWithPaths\_ViewStart.cshtml | ||
/Views/ViewWithPaths/Index.cshtml | ||
</ViewStart> | ||
<Index> | ||
/Views/ViewWithPaths/Index.cshtml | ||
/Views/ViewWithPaths/Index.cshtml | ||
<component> | ||
/Views/Shared/Components/ComponentForViewWithPaths/Default.cshtml | ||
/Views/Shared/Components/ComponentForViewWithPaths/Default.cshtml | ||
</component> | ||
<Partial> | ||
/Views/ViewWithPaths/_Partial.cshtml | ||
/Views/ViewWithPaths/_Partial.cshtml | ||
</Partial> | ||
</Index> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/WebSites/RazorWebSite/Components/ComponentForViewWithPaths.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.AspNet.Mvc; | ||
|
||
namespace MvcSample.Web.Components | ||
{ | ||
[ViewComponent(Name = "ComponentForViewWithPaths")] | ||
public class ComponentForViewWithPaths : ViewComponent | ||
{ | ||
public IViewComponentResult Invoke() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
test/WebSites/RazorWebSite/Controllers/ViewWithPathsController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.AspNet.Mvc; | ||
|
||
namespace RazorWebSite.Controllers | ||
{ | ||
public class ViewWithPathsController : Controller | ||
{ | ||
[HttpGet("/ViewWithPaths")] | ||
public IActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
test/WebSites/RazorWebSite/Views/Shared/Components/ComponentForViewWithPaths/Default.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<component> | ||
@ViewContext.ExecutingFilePath | ||
@ViewContext.View.Path | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Index> | ||
@ViewContext.ExecutingFilePath | ||
@ViewContext.View.Path | ||
@Component.Invoke("ComponentForViewWithPaths") | ||
@Html.Partial("_Partial") | ||
</Index> |
5 changes: 5 additions & 0 deletions
5
test/WebSites/RazorWebSite/Views/ViewWithPaths/_Layout.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Layout> | ||
@ViewContext.ExecutingFilePath | ||
@ViewContext.View.Path | ||
</Layout> | ||
@RenderBody() |
4 changes: 4 additions & 0 deletions
4
test/WebSites/RazorWebSite/Views/ViewWithPaths/_Partial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<Partial> | ||
@ViewContext.ExecutingFilePath | ||
@ViewContext.View.Path | ||
</Partial> |
Oops, something went wrong.