Engineering scalable systems, cloud-native applications, and AI-powered solutions.

Get Previous and Next page URLs in Umbraco

To get previous & next page URLs in Umbraco, you can use the below piece of code in your razor view.

Ankush Jain

Ankush Jain

Lead Software Engineer (VP) | Software Architect

Published Nov 28, 2018Updated Nov 24, 2026

To get previous & next page URLs in Umbraco, you can use the below piece of code in your razor view.

c#
@if(CurrentPage.Previous() != null){
<a href="@CurrentPage.Previous().Url">Previous</a>
}
@if(CurrentPage.Next() != null){
<a href="@CurrentPage.Next().Url">Next</a>
}

Have feedback or thoughts?

Discuss this article or share it on Twitter / GitHub.