Error: The 'media' attribute is not declared.

Jul 20, 2012 at 12:09 PM

Hi,

I am getting Error: The 'media' attribute is not declared.

My project on ASP.Net 4.0 with MVC3

i am using CSS Like

<link rel="stylesheet" media="only all and (min-width: 480px)" href="~/ css/480.css"/>
<link rel="stylesheet" media="only all and (min-width: 768px)" href="~/ css/68.css?v=1"/>
<link rel="stylesheet" media="only all and (min-width: 992px)" href="~/ css/992.css?v=1"/>

Now using the COMBRES

View File:

@using Combres.Mvc

@Combres.Mvc.MvcExtensions.CombresLink(Html, "siteCss")

Combres.XML:

<resource media="only all and (min-width: 480px)" path="~/ css/480.css"/>
<resource media="only all and (min-width: 768px)" path="~/ css/768.css?v=1"/>
<resource media="only all and (min-width: 992px)" path="~/ css/992.css?v=1"/>

facing this problem on page load, can you suggest the solution plz.

 Thanks

Aug 11, 2012 at 10:35 PM

media attribute isn't define in Combres resource element.  Instead of specify media query via attribute, use CSS for it, e.g. put this in 480.css:

media=only all and (min-width: 480px) {

// normal CSS here

}