Serious amateur here when it comes to C#. In .net I'm using a line of code to hide elements that I dont want to appear on a particular URL (below)
<% if (!HttpContext.Current.Request.Url.AbsoluteUri.Contains("/level-1"))
{ %>
Content here
<% } %>
How do I adjust the url string to hide elements on level-3 but not necessarily 2?...(below)
Contains("/level-1/.../level-3/")
I could just specify the absolute url for level-3 but there are hundreds of them, so looking for a way to exclude all urls under level-3
To always hide content for any URL that has 3 levels, then the following will do the trick.