473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1612
On Sep 27, 8:48 am, "Giganews" <br...@berzerker-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***@berzerker-soft.comwrote in message
news:iO******************************@giganews.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.com/folder1/page1.asp" css/reset-min.css will
refer to file "http://www.myserver.com/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***@berzerker-soft.comwrote in message
news:iO******************************@giganews.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...@berzerker-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***@berzerker-soft.comwrote in message
news:iO******************************@giganews.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.com/folder1/page1.asp" css/reset-min.css will
refer to file "http://www.myserver.com/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***@berzerker-soft.comwrote in message
news:iO******************************@giganews.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
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...
5
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...
2
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...
3
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...
0
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...
3
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
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)...
3
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.