Hi @Anjali Agarwal,
According to your description, I suggest you could consider using the javascript to achieve your requirement.
You could put a tag at the end of page like below:
<a id="goToTopLink" asp-page="yourrazorpagepath">Go to Top of the page</a>
and add below js:
@section Scripts {
<script>
document.addEventListener("DOMContentLoaded", function () {
var goToTopLink = document.getElementById("goToTopLink");
goToTopLink.addEventListener("click", function (e) {
e.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
});
</script>
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.