简体   繁体   中英

Refer to previous of previous page in ASP.NET Core 3.1 Razor Pages

in my Razor app I am trying to make back redirections to previous pages. I find good solution from this post https://stackoverflow.com/a/42228327/6485612 using Request.Headers["Referer"] , however, the problem is how to remember the previous backUrl of the previous page. When i want to go two pages back, I end up in a loop between two pages I was lastly on.

Do you have any ideas how to achieve to go multiple pages back?

you can use

Use @Html.ActionLink("Go Back","Actio Name","Controller Name")

or you can use javascript adding a back button

<button onclick="window.history.back()">Back</button>

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