The code you are using is for ASP.NET MVC. For ASP.NET Core or .NET 7 you have to use different approach. I am not sure what you are trying to achieve but below code example shows how you can retrieve URL
Looking into your code, you are using UmbNav package (Please correct if I am wrong). With UmbNav, there are various ways to check active page. Please check below code examples how I am using them
Request.Url.AbsoluteUri == (HttpContext.Current.Request.Host.GetLeftPart(UriPartial.Authority) + item.Url()) not working
This not working in.net 7 Umbraco 11
Hi Prashant,
The code you are using is for ASP.NET MVC. For ASP.NET Core or .NET 7 you have to use different approach. I am not sure what you are trying to achieve but below code example shows how you can retrieve URL
If you can explain me what you are trying to achieve then I could suggest you alternative code also.
Thanks
Regards, Pasang
I am using Umbraco 11 and .net 7 to achieve the page that equals to request page for Navbar. Please see the code below.
Hi Prasant,
Looking into your code, you are using UmbNav package (Please correct if I am wrong). With UmbNav, there are various ways to check active page. Please check below code examples how I am using them
First Solution:
Second Solution:
Third Solution:
I hope you will find this helpful to you.
Thanks
/Pasang
Thanks, Sir, great help ☻
is working on a reply...