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

Forums / Bugs & Issues / How link the CSS file in the custom .master file

How link the CSS file in the custom .master file

8 posts, 0 answered
  1. jitendra deora
    jitendra deora avatar
    16 posts
    Registered:
    18 Nov 2009
    03 Jan 2011
    Link to this post
    How link the CSS file in the custom .master file in Sitefinity 4.0 ?
    i am using below path in my master file but it's not working
    <link href="../App_Themes/theme/style.css" rel="stylesheet" type="text/css" media="all" />
    css file folder
    App_Data\Sitefinity\WebsiteTemplates\sample\App_Themes\theme\Global\style.css

    Jitendra
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Jan 2011
    Link to this post
    Hello jitendra,

    You can use CssEmbedControl

    <%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>
     
    <sf:CssEmbedControl runat="server" ID="CssEmbedControl1"  Url="Sitefinity/WebsiteTemplates/PageTemplates/App_Themes/Test/css/style.css" ></sf:JavaScriptEmbedControl>

    All styles that you put inside Global folder should be automatically loaded on your page.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. jitendra deora
    jitendra deora avatar
    16 posts
    Registered:
    18 Nov 2009
    03 Jan 2011
    Link to this post
    after implementing this i am getting the error i have attached the screen grab
    my custom master file code is here

    <%@ Master="" Language="C#" AutoEventWireup="true" CodeFile="main.master.cs" Inherits="App_Master_StandardPage" %><br>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br>
      <%@Register  TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%><br>
        <html xmlns="http://www.w3.org/1999/xhtml"><br>
          <head id="Head1" runat="server"><br>
            <%--  <link href="../App_Themes/theme/style.css" rel="stylesheet" type="text/css" media="all" />--%><br>
            <sf:CssEmbedControl runat="server" ID="CssEmbedControl1"<br>
                 Url="sitefinity/websitetemplates/sample/App_Themes/theme/style.css" ><br>
            </sf:CssEmbedControl ><br>
          </head><br>
          <body><br>
            <form id="form1" runat="server"><br>
              <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><br>
              <div id="header"><br>
                <asp:contentplaceholder id="head" runat="server"></asp:contentplaceholder><br>
              </div><br>
    <br>
              <div id="banner"><br>
                <asp:contentplaceholder id="gallery" runat="server"></asp:contentplaceholder><br>
              </div><br>
              <div class="contentWrapper"><br>
                <asp:contentplaceholder id="content" runat="server"></asp:contentplaceholder><br>
              </div><br>
              <div id="Footer" class="footer"><br>
                <asp:contentplaceholder id="copyright" runat="server"></asp:contentplaceholder><br>
              </div><br>
            </form><br>
          </body><br>
        </html>

     
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Jan 2011
    Link to this post
    Hi jitendra deora,

    You have a <br> tag inside of the declaration of the CssEmbedControl in your master page.

    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. jitendra deora
    jitendra deora avatar
    16 posts
    Registered:
    18 Nov 2009
    04 Jan 2011
    Link to this post
    Hi
    Just i have removed <br> tag but still i am getting the same error please check last thread attached screen grab
    Please let me know

    Please check my updated master file code below

    <%@ master language="C#" autoeventwireup="true" codefile="main.master.cs" inherits="App_Master_main" %>
    <%@Register  TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:scriptmanager id="ScriptManager1" runat="server"></asp:scriptmanager>
        <sf:cssembedcontrol runat="server" id="CssEmbedControl1" url="Sitefinity/WebsiteTemplates/sample/App_Themes/theme/style.css"></sf:cssembedcontrol>
        <div id="header">
        </div>
        <div class="contentWrapper">
        </div>
        <div id="Footer" class="footer">
        </div>
        </form>
    </body>
    </html>
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Jan 2011
    Link to this post
    Hi jitendra,

    Please take a look at the code below that shows how to register you custom stylesheet

    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
      <p> </p>
     
      <sf:CssEmbedControl MediaType="screen" runat="server" ID="CssEmbedControl1" Url="/empty/Sitefinity/WebsiteTemplates/PageTemplates/App_Themes/Test/css/styles.css" />
     </form>



    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. jitendra deora
    jitendra deora avatar
    16 posts
    Registered:
    18 Nov 2009
    04 Jan 2011
    Link to this post
    Thanks a lot it's working now .... :)
    Jitendra
  8. Derek
    Derek avatar
    1 posts
    Registered:
    14 Mar 2014
    19 Mar 2014 in reply to Ivan Dimitrov
    Link to this post

    if my data structure started at App_Data, I would just put "App_Data" instead of "empty"? or is that some sort of pre-defined structure?

     

    *Extremely new to Sitefinity

8 posts, 0 answered