[英]Produce a “type” attribute in the “script” tag when using Scripts.Render in ASP.NET MVC 4
Is it possible to configure Scripts.Render in ASP.NET MVC 4 to produce a "type" attribute in the "script" tag? 是否可以在ASP.NET MVC 4中配置Scripts.Render以在“script”标记中生成“type”属性?
If so, how? 如果是这样,怎么样?
Thanks in advance, 提前致谢,
Ryan 瑞安
The 1.1-alpha1 update has support doing your own tag formatting with the Scripts/Styles helpers. 1.1-alpha1更新支持使用Scripts / Styles帮助程序进行自己的标记格式化。
There's a new DefaultTagFormat property which is by default set to: 有一个新的DefaultTagFormat属性,默认情况下设置为:
"<script src="{0}"></script>"
There's also a RenderFormat method which takes in the tag format as well. 还有一个RenderFormat方法,它也采用标记格式。 You should be able to add the type attribute via either of these two mechanicsms.
您应该能够通过这两种机制中的任何一种添加type属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.