How can I set "media" parameter in link?

Jun 18, 2013 at 8:16 AM
Edited Jun 18, 2013 at 3:28 PM
Hi!
I have the following set of styles:
<link rel="stylesheet" type="text/css" href="/assets/css/core.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/assets/css/jquery.fancybox-1.3.4.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/assets/css/cookie.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/assets/css/print.css" media="print" />
How can I set "media" parameter in bundle transformer?
Thanks
Coordinator
Jun 18, 2013 at 5:49 PM
Hello, vasilega_74!

This problem is solved at the level of the Microsoft ASP.NET Web Optimization Framework since version 1.1.0 Alpha 1 (corresponds to the Bundle Transformer version 1.7.X Beta 1). Here is an example code:
@Styles.RenderFormat(@"<link rel=""stylesheet"" href=""{0}"" media=""screen"">", "~/Bundles/CommonStyles")
Details can be found in the Howard Dierking's article «New Web Optimization Pre-Release Package on NuGet».
Jun 19, 2013 at 3:34 AM
Mmm, thanks!
Oct 1, 2013 at 11:31 AM
Hello again.

How can I affect the values ​​in the media for a specific item?

I do not accept that the media are not controlled by the value!

<link rel="stylesheet" type="text/css" href="/assets/css/core.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/assets/css/jquery.fancybox-1.3.4.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/assets/css/cookie.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/assets/css/print.css" media="print" />

Thanks!
Coordinator
Oct 1, 2013 at 11:42 AM
Hello, Vasilega!

Only by splitting files into separate bundles.

In General, this issue relates more to the Microsoft ASP.NET Web Optimization Framework, than to the Bundle Transformer.