Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application built on ASP.net and Sitecore.The application uses a common layout(.aspx file) from sitecore.

Now I have to add a link tag(<link rel="xxx" href="yyy" />) under head section to a single page.To achieve this,I have to edit common layout but the link tag should appear only on the page I want and not on other pages.How can I achieve this?

I got the below code to add to my common layout.aspx but it is not working and I don't understand what it does.

<% string currentURL = Request.RawUrl;
if (currentURL == "/") {%>
<link rel="xxx" href="yyy" />
<% } %>

why we use <% %>?
Posted

1 solution

This has nothing to do with Sitecore specifics, this is just ASP.NET syntax of separating Server side code and the HTML markup. I recommend to read on how this works before understanding how it is used within your sitecore
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900