Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicky Christensen 76 posts 166 karma points
    Jan 30, 2012 @ 13:11
    Nicky Christensen
    0

    Is it possible to link a stylesheet to an aspx file?

    Is it possible to link a stylesheet to a .aspx file, fx, like this: 

    <link href="~/static/css/style.aspx" rel="stylesheet" />
    <!--[if (lt IE 9)&(!IEMobile 7)]> <link href="~/static/css/style-nomq.aspx" rel="stylesheet" /> <![endif]-->

    When I do it, it cant get the stylesheet from the .aspx file - And style.aspx contains this: 

    <!--#include file="style.css"-->
    /* ==|== media queries ====================================================== */
    @media only screen and (min-width: 480px) {
    <!--#include file="style-480.css"-->
    }
    @media only screen and (min-width: 768px) {
    <!--#include file="style-768.css"-->
    }
    @media only screen and (min-width: 960px) {
    <!--#include file="style-960.css"-->
    }

     

     

  • Rodion Novoselov 694 posts 859 karma points
    Jan 30, 2012 @ 14:40
    Rodion Novoselov
    0

    Yes, it is. As long as your aspx really generates CSS and set the right Content-type on the response (actually even this is not absolutely necessary - you can just provide type="text/css" right in the <link> tag). But, in fact you'd better implement such things as a *.ashx generic handler.

Please Sign in or register to post replies

Write your reply to:

Draft