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

  • SEARCH
  • Home
  • 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 6808799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:59:59+00:00 2026-05-26T19:59:59+00:00

I have a class library which is being used by another project, it is

  • 0

I have a class library which is being used by another project, it is added in the toolbox, then dragged onto the page. Works great!

Only problem is that I want some styling added.

In my class library I have:

  1. added a css file “PayMyBillClassLibrary.main.css”,

  2. added the following to the AssemblyInfo:

    [assembly: WebResource(“PayMyBillClassLibrary.main.css”, “text/css”)]

  3. added the css file in the main class using the following code:

        string cssUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "PayMyBillClassLibrary.main.css");
    
        HtmlLink cssLink = new HtmlLink();
        cssLink.Href = cssUrl;
        cssLink.Attributes.Add("rel", "stylesheet");
        cssLink.Attributes.Add("type", "text/css");
    
        this.Page.Header.Controls.Add(cssLink);  
    

This produces the following in the solution that I mentioned earlier which hold the class library.

<link href="/TestTwo/WebResource.axd?d=DkBjNt27-P0jDJmlJk7Z40MOLq_coWgDQBzgcFJIGLo-9W-RQClfELNEGAApBuu-kkPiYrB_2uU24xTCwXsn5uKPcaWSRY7vHpLnJEGzoCJ9DdIrd-9StVNbLyRKSYvvUA4x2w2&amp;t=634563635276884818" rel="stylesheet" type="text/css" />

If I click on the link in the view source, it just shows a blank page, if I change the CSS reference to murr.css it will say not found. So it seems to be finding the CSS file, but not doing anything with it or picking up the CSSin the file.

Does anyone have any suggestions?

  • 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-05-26T20:00:00+00:00Added an answer on May 26, 2026 at 8:00 pm

    You could try putting a literal control in the header, and setting the literal content in code-behind.

    <asp:Literal id="cssliteral" runat="server" /> 
    

    Code-behind:

    cssLiteral.Text = String.Format("<link href='{0}' rel='stylesheet' type='text/css' />", cssUrl);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class library project which contains some content files configured with the
I have a class, which is part of a code library project that was
I have a Class Library project which houses some shared code between other projects
I have created a class library called AddServiceLibrary in which I have a method
I have a WCF Web Service which is referenced from a class library. After
I have an solution in VS 2008 which contains two class library projects and
I am using the apache library. I have created a class which sends a
I just added a class library project to my .NET solution. When I built
I have a C# class library which uses a form (which is also in
We have a class library where we keep a lot of the stuff that

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.