How to output type=javascript from Scripts.Render using bundles

271 Views Asked by At

In My Master page I have the following lines :

<%: Scripts.Render("~/bundles/SiteJS") %>

It correctly outputs the bundles as :

    <script src="/Scripts/jquery-2.1.0.min.js"></script>
<script src="/Scripts/ie10-viewport-bug-workaround.js"></script>
<script src="/Scripts/bootstrap.min.js"></script>
<script src="/Scripts/Main.js"></script>

But I want it like this with type="text/javascript"

    <script src="/Scripts/jquery-2.1.0.min.js" type="text/javascript"></script>
<script src="/Scripts/ie10-viewport-bug-workaround.js" type="text/javascript"></script>
<script src="/Scripts/bootstrap.min.js" type="text/javascript"></script>
<script src="/Scripts/Main.js" type="text/javascript"></script>

What needs to be done for this ?

This post How do I add type="text/javascript" to a script tag when using System.Web.Optimization focuses on a single javascript file but I have many files in that bundle.

0

There are 0 best solutions below