@williamHe-27
as @Zhi Lv - MSFT pointed out, you have @man_man9987 object that you can make use of.
Here is the official documentation for Requets object: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequest?view=aspnetcore-6.0#properties
One such property of Request is PATH. You will have to use it like @man_man9987 .Path. this will get you the request path of the current request.
For e.g. if the request was for https://www.yourdomain.com/people/lohith - @man_man9987 .Path will return /people/lohith
Hope this helps.
Note: Please mark this as an Answer, if your question/issue was solved. Thanks.