CSS and Asp.net 3.5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    CSS and Asp.net 3.5

    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
  • =?Utf-8?B?SmFzb24gSGVkZ2Vz?=

    #2
    RE: CSS and Asp.net 3.5

    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 <styleinformati on to the page header at runtime in the
    Page_Load event. Here's an example in C#:

    protected void Page_Load(objec t sender, EventArgs e)
    {
    HtmlGenericCont rol style = new HtmlGenericCont rol("style");
    style.Attribute s.Add("type", "text/css");
    style.Attribute s.Add("media", "Screen");
    style.InnerText = "@import url(/master.css);";
    Page.Header.Con trols.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
    >

    Comment

    Working...