生产和QUOT;类型"属性中的"脚本"使用ASP.NET MVC Scripts.Render时4标签 [英] Produce a "type" attribute in the "script" tag when using Scripts.Render in ASP.NET MVC 4
本文介绍了生产和QUOT;类型"属性中的"脚本"使用ASP.NET MVC Scripts.Render时4标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能在ASP.NET MVC 4配置Scripts.Render在脚本的标签,以产生类型属性?
Is it possible to configure Scripts.Render in ASP.NET MVC 4 to produce a "type" attribute in the "script" tag?
如果是这样,怎么样?
由于提前,
瑞安
推荐答案
1.1-ALPHA1更新已支持做自己的标记和脚本/样式助手格式化。
The 1.1-alpha1 update has support doing your own tag formatting with the Scripts/Styles helpers.
还有这是默认设置为一个新的DefaultTagFormat属性:
There's a new DefaultTagFormat property which is by default set to:
"<script src="{0}"></script>"
还有一个RenderFormat方法,需要在标签格式以及。您应该能够通过这两种mechanicsms的添加类型属性。
There's also a RenderFormat method which takes in the tag format as well. You should be able to add the type attribute via either of these two mechanicsms.
这篇关于生产和QUOT;类型&QUOT;属性中的&QUOT;脚本&QUOT;使用ASP.NET MVC Scripts.Render时4标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文