PC Review


Reply
Thread Tools Rate Thread

CSS and Asp.net 3.5

 
 
shapper
Guest
Posts: n/a
 
      1st Mar 2008
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
 
Reply With Quote
 
 
 
 
Jason Hedges
Guest
Posts: n/a
 
      2nd Mar 2008
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

"shapper" wrote:

> 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
>

 
Reply With Quote
 
clintonG
Guest
Posts: n/a
 
      2nd Mar 2008
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.


"shapper" <(E-Mail Removed)> wrote in message
news:da860f31-4452-4432-9ce1-(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:03 AM.