473,785 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

links and master pages

I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master page,
so any page that's not in the same folder as the master page, don't display
the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce


Sep 26 '07 #1
6 1636
On Sep 27, 8:48 am, "Giganews" <br...@berzerke r-soft.comwrote:
I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master page,
so any page that's not in the same folder as the master page, don't display
the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce
Hi Bryce

Try this:
<link runat="server" href="~/css/reset-min.css" rel="stylesheet "
media="all" />

The tilde won't resolve to your application root unless it's a server-
side control.

Chris

Sep 27 '07 #2
This is an issue that is discussed at length in the forums at asp.net.
"Giganews" <br***@berzerke r-soft.comwrote in message
news:iO******** *************** *******@giganew s.com...
I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master
page, so any page that's not in the same folder as the master page, don't
display the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce


Sep 27 '07 #3
I bet you are not telling us the truth..... :)
You probably refer to reset-min.css without first slash. Like
<link href="css/reset-min.css" rel="stylesheet " media="all" />
This is called relative path and it refers to the path relative you current
page location.
so for "http://www.myserver.co m/folder1/page1.asp" css/reset-min.css will
refer to file "http://www.myserver.co m/folder1/css/reset-min.css"
Just make sure you have it as you wrote it here... with first slash like
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

then it's going to be absolute path and refer to
http://www.myserver.com/css/reset-min.css
George

"Giganews" <br***@berzerke r-soft.comwrote in message
news:iO******** *************** *******@giganew s.com...
I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master
page, so any page that's not in the same folder as the master page, don't
display the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce


Sep 27 '07 #4
Chris Fulstow wrote:
On Sep 27, 8:48 am, "Giganews" <br...@berzerke r-soft.comwrote:
>I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master page,
so any page that's not in the same folder as the master page, don't display
the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce

Hi Bryce

Try this:
<link runat="server" href="~/css/reset-min.css" rel="stylesheet "
media="all" />

The tilde won't resolve to your application root unless it's a server-
side control.
Thanks. that worked like a charm. Should have thought to do the
runat="server" bit...
Oct 2 '07 #5
clintonG wrote:
This is an issue that is discussed at length in the forums at asp.net.
Thanks. I'd visited asp.net before, but not the forums. I'll be checking
that out from now on. Thanks

"Giganews" <br***@berzerke r-soft.comwrote in message
news:iO******** *************** *******@giganew s.com...
>I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master
page, so any page that's not in the same folder as the master page, don't
display the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce


Oct 2 '07 #6
George Ter-Saakov wrote:
I bet you are not telling us the truth..... :)
You probably refer to reset-min.css without first slash. Like
<link href="css/reset-min.css" rel="stylesheet " media="all" />
That's entirely possible. I thought I had tried it with the slash in
front, but might have been incorrect.
This is called relative path and it refers to the path relative you current
page location.
so for "http://www.myserver.co m/folder1/page1.asp" css/reset-min.css will
refer to file "http://www.myserver.co m/folder1/css/reset-min.css"
Just make sure you have it as you wrote it here... with first slash like
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

then it's going to be absolute path and refer to
http://www.myserver.com/css/reset-min.css
George

"Giganews" <br***@berzerke r-soft.comwrote in message
news:iO******** *************** *******@giganew s.com...
>I've got a master page, with stylesheets on it defined as such:
<link href="/css/reset-min.css" rel="stylesheet " media="all" />

problem is, I have pages in different folders that link to that master
page, so any page that's not in the same folder as the master page, don't
display the css. I've tried the following:

<link href="~/css/reset-min.css" rel="stylesheet " media="all" />

which didn't work.

This did work
<link href="<%= ResolveUrl("~/css/reset-min.css") %>" rel="stylesheet "
media="all" />
But the styles don't show up in design.

Hints/tips greatly appreciated.

Thanks

Bryce


Oct 2 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1010
by: Simon Brunning | last post by:
QOTW: "The posts do share an erroneous, implied assumption that the investment in learning each language is equal. Python has a strong competitive advantage over Java and C++ in terms of learnability. A person can get up to speed in a few days with Python." - Raymond Hettinger "You know, this is the most concise example of feature-creep in a specification that I've ever seen." - Christopher Subich "With Lisp or Forth, a master...
5
2439
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the web part page? Does it take place at the page level? ...or the content area level? 3. Where is the Web Part Manager instantiated? ...in the Master Page? ....Content Page? ...elsewhere?
2
1880
by: Steve Franks | last post by:
I am familiar with the fact that you have to use runat=server and links staring with "~/" to ensure proper mapping of paths to relative URLs when using master pages. However this does not seem to work in all cases. For instance, assume I have a "/mysite/images" subdirectory with mybackground.gif and mygif.gif in there. Further assume I have a master page called mastertest.aspx located in /mysite/myfolder".
3
1421
by: Brett Baisley | last post by:
Hello, I am having trouble figuring out URL's from my master page. Here is my setup. I have a default.aspx and default.master file in the root folder. I have an "images" folder with logos and css files in there. I also have a "html" folder with more pages in there. The default.aspx file loads find, but when I open any of the other files under "html" folder, the linking is off therefore the logo's and css can't
0
1021
by: Learner | last post by:
Hello, we are using Master Pages in asp.net 2.0. Our Master page has three contentplaceholders. On the left most ContentPlaceHolder we have all the links for the navigation of the site. One of the links on it is "Admin" link. Now, if some one with "Admin" Role logs in and clicks on it then the "Admin" link should populate all the other links underneath the "Admin" link. I am looking for some thing like toggel link. Can some one please...
3
1203
by: Samuel Shulman | last post by:
Since the master page is used in pages located in many folders how can I add relative links to the master page? Thank you, Samuel
0
1189
by: Paul Boddie | last post by:
QOTW: "Given these criteria, my recommendations for a first programming language would be Python or Scheme." - Peter Norvig (some time ago, but referenced on comp.lang.lisp this week) http://www.norvig.com/21-days.html "however if you want more visual effect with less hassle, consider learning Python instead. with Python you can get some graphical stuff working almost out-of-the box, while with Lisp it's matter of luck if particular...
3
5975
by: Rich | last post by:
Hi, I want to use 2 master pages, one for the main part of the site, the other for the admin pages. They are quite similar, with many shared elements. Ideally I would like to have a parent master page, which both of these child master pages are based on, and in turn the final pages are based on one of these child master pages.
0
1195
by: Cameron Laird | last post by:
QOTW: "I have a fake supervisor reference generator for job interviews, a fake house inspection generator for real estate transactions, and a fake parole testimony generator - maybe you could adapt one of them (unfortunately, they are written in dissembler)." - Paul McGuire "... I think that is the most interesting work in CS in many years." - Jacob Hallen PyPy 1.0 is ready--yippee!
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.