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);
}