Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

CSS and Asp.net 3.5

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 01 Mar 2008 17:25 GMT
Hello,

I would like to use something as follows in my web site:

Master.css
 @import url("reset.css");
 @import url("global.css");
 @import url("flash.css");
 @import url("structure.css");

MyPage.Aspx
<style type="text/css" media="Screen">
/*\*/@import url("master.css");/**/
</style>

Can I do this using App_Themes, i.e., placing my CSS files in
App_Themes?

And how can I add

<style type="text/css" media="Screen">
/*\*/@import url("master.css");/**/
</style>

To my Page.Aspx head tag at runtime, and in which event should I do
this?

Thanks,

Miguel
Jason Hedges - 02 Mar 2008 03:21 GMT
You can reference CSS files from themes. You'll just need to include the
relative path to the theme (example: /app_themes/theme1/style.css).

You can add your <style> information to the page header at runtime in the
Page_Load event. Here's an example in C#:

protected void Page_Load(object sender, EventArgs e)
   {
       HtmlGenericControl style = new HtmlGenericControl("style");
       style.Attributes.Add("type", "text/css");
       style.Attributes.Add("media", "Screen");
       style.InnerText = "@import url(/master.css);";
       Page.Header.Controls.Add(style);
   }

Jason

> Hello,
>
[quoted text clipped - 26 lines]
>
> Miguel
clintonG - 02 Mar 2008 19:29 GMT
I'm sorry I don't remember the exact details but 2.0 Skins and Themes were
and remain FUBAR as to my knowledge nobody has bothered to refine the design
flaws from 2.0 once releasing 3.0 and then 3.5.

So if you put files and folders in App_Theme folder they are going to be
sorted and loaded out of sequence or something to that effect. Hence your
style declarations will override one another. I've seen a goofy work-around
using a naming scheme that forces contents of App_Themes to sort as wanted.

Again, Microsoft keeps releasing buggy software without fixing it leaving it
as trash and in this context it has something to do with sorting so be
advised. Again, as far as I know none of the bugs or design flaws of 2.0
have been repaired or there would be blogs all over the web making note of
it.

But remember, when its from Microsoft? Its a feature.

> Hello,
>
[quoted text clipped - 26 lines]
>
> Miguel

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.