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

Forums / General Discussions / Using 2 style sheets

Using 2 style sheets

2 posts, 0 answered
  1. Troy Lawrence
    Troy Lawrence avatar
    56 posts
    Registered:
    07 Jan 2010
    11 Jan 2010
    Link to this post
    I have created 1 theme and I'm using 2 templates within it.  One is for the Home page and the other is for the Interior pages.  I want to use 1 css file for each template, but I can't get it to work. It appears that the interior.css always writes over the home.css.   I've attached a screenshot of what I edited.




  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Jan 2010
    Link to this post
    Hello Troy Lawrence,

    You could try to use Page.Header.Controls.Remove in your master pages to remove the undesirable stylesheet from the head content.

    below is a sample code

    protected override void OnPreRender(EventArgs e)
       {
           base.OnPreRender(e);
     
           for (int i = 0; i < Page.Header.Controls.Count; i++)
           {
               Control c = this.Page.Header.Controls[i] as Control;
               if (c is HtmlLink && (((HtmlLink)c).Href.Equals("../App_Themes/Blue with right sidebar/sh.css")))
               {
                   Page.Header.Controls.Remove(c);
               }
           }
       }

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered