简体   繁体   中英

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

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

 <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.

不敢相信,但这行得通。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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