简体   繁体   English

剃刀页面-如何使用asp-for标记帮助程序重定向到另一个文件夹的页面

[英]Razor Page - How to redirect to another folder's page using asp-for tag helper

I've been having issues with this but I think is simple. 我一直对此有疑问,但我认为很简单。

asp.net core 2.0 Razor Pages asp.net core 2.0 Razor页面

I have a Users/index page and I added a link to take me to the child records under Entries Folder. 我有一个“用户/索引”页面,并且添加了一个链接以将我带到“条目”文件夹下的子记录。

Structure is like Pages /Users /Entries 结构就像页面/用户/条目

Under /Pages/Users/index.cshtml 在/Pages/Users/index.cshtml下

 <a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
   <a asp-page="./Details" asp-route-id="@item.Id">Details</a>|
   <a asp-page="~/Pages/Entries/" asp-route-id="@item.Id">Enter Child Records</a>

However, on the browser, looks like is not rendering the correct link. 但是,在浏览器上,看起来好像没有呈现正确的链接。 It staying under the default page. 它停留在默认页面下。

I tried asp-page="../Entries/" and other combinations with no luck. 我尝试了asp-page="../Entries/"和其他组合没有运气。

不敢相信,但这行得通。

<a asp-page="../Entries/Index" asp-route-id="@item.Id">test</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM