Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:20:32+00:00 2026-06-02T01:20:32+00:00

Answer Posting this here as 8 hours hasnt passed for me to answer my

  • 0

Answer

Posting this here as 8 hours hasnt passed for me to answer my own question:

I figured this out. I removed Server.MapPath from the PreRender and it rendered it correct. Brain fart on my part. Thanks guys

in my code i have:

CssIncludes.Add("~/Sites/0/PageLayouts/Predefined/News/CSS/HeaderMenu.css");

Once rendered on page it comes out in the page source as:

 <link href='C:\inetpub\wwwroot\mysite\Sites\0\PageLayouts\Predefined\News\CSS\HeaderMenu.css' type='text/css' rel='stylesheet' />

now if i manually copy that css url and paste it in my browser, it loads the css fine, yet it will not show up on my c:\localhost\mysite\ at all!

Any solutions?

CSS Includes list:

public List<string> CssIncludes
    {
        get
        {
            if (_cssincluded == null)
                _cssincluded = new List<string>();
            return _cssincluded;
        }
    }

void Page_PreRender(object sender, EventArgs e)
    {
        foreach (string css in CssIncludes)
        {
            Page.Header.Controls.Add(new LiteralControl(string.Format("<link href='{0}' type='text/css' rel='stylesheet' />", Server.MapPath(css))));
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:20:33+00:00Added an answer on June 2, 2026 at 1:20 am

    figured this out. I removed Server.MapPath from the PreRender and it rendered it correct. Thanks guys.

    Changed:

    CssIncludes.Add("~/Sites/0/PageLayouts/Predefined/News/CSS/HeaderMenu.css");
    

    to:

    CssIncludes.Add("../Sites/0/PageLayouts/Predefined/News/CSS/HeaderMenu.css");
    

    and changed

    void Page_PreRender(object sender, EventArgs e)
    {
        foreach (string css in CssIncludes)
        {
            Page.Header.Controls.Add(new LiteralControl(string.Format("<link href='{0}' type='text/css' rel='stylesheet' />", Server.MapPath(css))));
        }
    }
    

    to:

    void Page_PreRender(object sender, EventArgs e)
    {
        foreach (string css in CssIncludes)
        {
            Page.Header.Controls.Add(new LiteralControl(string.Format("<link href='{0}' type='text/css' rel='stylesheet' />", (css))));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to integrated linkedIn using this question answer Posting LinkedIn message from
I spent half an hour finding the answer to this question. Posting it here
I figured out the answer to this question, but I couldn't find the solution
First sorry for posting this here.I just got no answer to this question on
This is my first time posting a question here, it has been a valuable
I know the answer to this, but I'm posting this here because as an
There's this question but it has nothing close to help me out here. Tried
I feel very very very silly posting this, but I can't find the answer.
Note: I am cross-posting this from App Engine group because I got no answers
Just posting the solution I worked out today. See my answer below. If you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.