YAFLogo

ahsan
  • ahsan
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Per an earlier post I was successful in dropping a Site.master on top of the default.aspx that YAF runs off of. However, when I add a new stylesheet to the tag I get the following error:

There has been a serious error loading the forum. No futher information is available.

Please contact the administrator if this message persists.

I don't understand why adding a reference to a stylesheet would break the forum. I am hoping to use this simple .css file in addition to the YAF thematic CSS files specifically to handle the layout of my Site.master.

Sponsor
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
16 years ago
Turn customErrors "Off" in web.config and then tell us the real error...

Also, provide the exact code here so we can see more what's wrong.

It's really hard to help if you don't help us understand the situation...

ahsan
  • ahsan
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Fixed the error by adding the css as a control to YafHead (the header object) in the code behind. In response to your question, I was originally trying the following:

<head id="YafHead" runat="server">
      <link href="<%= Page.ResolveUrl("~/public/stylesheets/Main.css") %>" rel="stylesheet" type="text/css" />
</head>

I removed the offending tag and replaced it with the following in my Site.master code behind to make it work:

        if (!IsPostBack)
        {
            HtmlLink _css = new HtmlLink();
            _css.Href = "public/stylesheets/Main.css";
            _css.Attributes.Add("type", "text/css");
            _css.Attributes.Add("rel", "stylesheet");

            YafHead.Controls.Add(_css);
        }
ahsan
  • ahsan
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
After further testing, I had to remove the IsPostBack check as the stylesheet became lost on a couple pages.