473,756 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Masterpages css problems

Im having a masterpages meltdown. I previously did an app where the
masterpage and aspx pages were in the same folder, no problems. In a second
app, for esthetics, I put the masterpage in the root and the aspx pages in a
/Pages folder. If I hard-code the css <LINK statement in the masterpage the
classes are used as expected. However, in this app the .css (and other stuff)
is in user-specific folders, so I need to perform this programatically ; Im
using the methods below from
http://pluralsight.com/blogs/ted/arc.../31/14437.aspx

No matter what I could think of to pass as the stylesheet
("./Images/User1/xx.css", and any variation of it), the css classes (which
for right now just control fonts) arent used. I wound up doing View Sources
on the html, and the only way to get the exact same href as when I hardcoded
it required me to change
link1.Href = page.ResolveUrl (stylesheet);
to
link1.Href = "."+page.Resolv eUrl(stylesheet );
But it didnt matter, even when I generated equivalent html the
classes werent used.
Any help would be massively appreciated, Ive beaten my head on this way to
long.

Thanks, Mark
public void AddLinkedStyleS heet(Page page, string stylesheet)
{
HtmlLink link1 = new HtmlLink();
link1.Href = page.ResolveUrl (stylesheet);
link1.Attribute s["text"] = "text/css";
link1.Attribute s["rel"] = "stylesheet ";

page.Header.Con trols.Add(link1 );
}
public void AddLinkedStyleS heet(MasterPage page, string stylesheet)
{
this.AddLinkedS tyleSheet(page. Page, stylesheet);
}
Oct 26 '06 #1
1 1468
MarkAurit wrote:
No matter what I could think of to pass as the stylesheet
("./Images/User1/xx.css", and any variation of it),
Are you passing ~ as part of the CSS path? E.g.:

AddLinkedStyleS heet( page, "~/css/xxx.css" );

Your question is a little confusing. What is the HTML output for each
of the variations you've tried?

apathetic
Oct 26 '06 #2

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

Similar topics

0
1123
by: Steven Blair | last post by:
Hi, I have started using MasterPages (2005) and having a couple of problems I hope soemone can help me out with. 1. When I create a ContentPlaceHolder is it possible to make this component full screen in design mode. It really is quite difficult to create my screens and not be able to resize. 2. The design of my Master Page is quite simple. I want a header with
6
1768
by: Kenneth Keeley | last post by:
Hi, I have a Masterpage that controls the basic layout of the pages displayed on a web site. The masterpage also uses some variables. I would like to be able to access some of these variables from the content pages. Can this be done and if so how. I have made the Varibles that I wish to access Public Members. Thanks for any help. Kenneth
2
2467
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
3
1512
by: Markus Rytterkull | last post by:
I'm porting an application from asp to asp.net2.0 and thought this would be a good time to test masterpages and themes. The end result is fine but I find it difficult to recreate forms in designmode since the pages gets very cluttered (controls on top of each other, stylesheet from theme not applied). The forms use both layers with absolute positioning and styles (from stylesheet in themes). Does everybody have the same problems with...
5
4319
by: Nick Wouters | last post by:
Dear All In Classic ASP I used CSS for ALL layout. Now in ASP.NET version 2 I am testing out Masterpages as they come in very handy. It seems like it is replacing CSS for layout but what is the best choise? 1) Using Masterpages with Themes (css / images / skins included in this theme)
4
1683
by: Sean | last post by:
My experience now working with master pages on and off for 6 months is that they can be very dangerous when working with themes. One example in particular is the changes I made to my banner menu which now work just fine with all my themes on my development machine but on my production server my non-standard themes are showing effects that are no longer in place even with a complete re-copy of my project. Problems like this with...
9
2143
by: RBM007 | last post by:
Hello, I have created some pages in the (old) Atlas pages and migrated to AJAX version. After the update I noticed that any page containing ASP.NET AJAX won't compile anymore. Even if the same tags and properties are used in a page without a masterpage. Does anyone shares this exprerience with me or does anyone knows an answer? For the time being, I copy-pased the headings in my masterpage to the clield pages.
6
1979
by: =?Utf-8?B?U3RlcGhlbiBIYXRmaWVsZA==?= | last post by:
I have two masterpages in a web application. One is used for the login and logout pages. The other is used for all other pages in the application. The difference between the two masterpages is that on the main one I have a user control in the left side that has the site navigation menu while the login/logout masterpage has a non-breaking space in that table cell. Everything else is exactly the same. The issue is that the login/logout...
8
11792
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to manage. I have 300 lines of styles in my masterpage and I don't need all of this for every page -- somehow this can't be a smart way of managing styles. How do I programmatically apply styles in my MasterPage based on the ContentPlaceHolder...
0
9456
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
9275
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
10034
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
9843
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
8713
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...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
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...
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.