I have developed a search page and am using <%# SearchResultUrl() %> to get the path of the page found.
<%# SearchResultUrl() %>
Is it possible to strip away everything after and including the last / or maybe just show the path of the pages parent?
/
Right now, as an example, <%# SearchResultUrl() %> is giving me the following, but I only want what is bolded:
http://websitename.com/our-policies/global-administrative-manual/02-communications/ad-02-040
Is what I'm asking for possible?
This should work :
<%# SearchResultUrl().Substring(0, SearchResultUrl().LastIndexOf('/')) %>
Thank you so much, that worked perfectly. The question I get from people all the time is. "I found the file while searching but I don't know what page it was on to get more relevant information." This will help immensely.
Please, sign in to be able to submit a new answer.