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 6737307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:14:01+00:00 2026-05-26T11:14:01+00:00

I am using asp.NET with masterpages and usercontrols. In MasterPage: Doing <link href='<%=ResolveUrl(~/path/file.css)%>’ rel=stylesheet

  • 0

I am using asp.NET with masterpages and usercontrols.

In MasterPage:

Doing

<link href='<%=ResolveUrl("~/path/file.css")%>' rel="stylesheet" type="text/css" />

will not work and the css will not load
BUT

Doing

<link runat="server" href='~/path/file.css' rel="stylesheet" type="text/css" />

will work and the css will load

In User Control:

Doing

<link runat="server" href='~/path/file.css' rel="stylesheet" type="text/css" />

will not work and the css will not load

BUT

Doing

<link href='<%=ResolveUrl("~/path/file.css")%>' rel="stylesheet" type="text/css" />

will work and the css will load

In master page ResolveUrl doesn’t work and runat=”server” works where in user control the opposite is the true. Maybe I worng and I appriciate if someone will check this. If this is the situation, what is the reason for this inconsistency?

  • 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-26T11:14:02+00:00Added an answer on May 26, 2026 at 11:14 am

    Ok, I got it.
    In one of the cases I had <head runat="server"> tag. Because the runat=”server”, the ResolveUrl is not act as a server method but a simple text. That is why ResolveUrl didn’t word – I had runat=”server” in the head tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working in an ASP.NET MasterPage and am having trouble with <link href="..."
I have a css based asp.net masterpage. I am using a browse div located
Using ASP.net, how do you write ANSI characters to a text file? I need
Using ASP.NET MVC 2 and and Html.RenderAction in my masterpage implemented as below throws
TGIF, I have a website I'm developing which is using ASP.NET masterpage/sitemap/content pages setup.
I am using Asp.Net c# and Sql Server 2005. I am using Masterpage and
I am using asp.net 4, .net 4 and masterpages. I added in the following
using asp.net mvc. I have various links in the masterpage. eg /Home/ /Home/About /News/
I'm using webforms ASP.NET, with masterpages. I want to add a LANG attribute to
I am using Master Pages in an ASP.NET MVC app that lets you submit

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.