1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Relative links

Relative links

2 posts, 0 answered
  1. Alex
    Alex avatar
    10 posts
    Registered:
    21 Nov 2007
    05 Mar 2008
    Link to this post
    Hi what is the best way to reference css links etc in master files?

    Everything works fine until I click a link to something like a page with a single news item on it. This is because the url changes to something like:

    http://localhost/test/newsDetail/08-03-02/new_site_released.aspx

    Any ideas?

    Thanks,

    Alex
  2. Katia
    Katia avatar
    194 posts
    Registered:
    01 Jul 2016
    06 Mar 2008
    Link to this post
    Hello Alex,

    I suggest that you add the CSS file in the HEAD tag of the master page (for example to App_Master/Default.master) like this:

    <head runat="server">  
        <title>Untitled Page</title> 
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />   
        <link media="screen" rel="stylesheet" type="text/css" href="~/App_Themes/Blue/styles.css" runat="server" /> 
    </head> 

    In the href attribute of the link tag write the path to the CSS file starting from the root folder of your site starting with ~/ . Don't forget to set the value of the runat attribute to server.

    Sincerely yours,
    Katia
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered