简体   繁体   English

ASP.NET MVC UserControl 需要 css/javascript

[英]ASP.NET MVC UserControl requires css/javascript

I have a user control (a user details form) which has a lot of javascript and css attached to it.我有一个用户控件(一个用户详细信息表单),其中附加了很多 javascript 和 css。 i'm struggling to make my control decalre that it needs a certain file so it will be included in the "head" section of the html.我正在努力使我的控件声明它需要某个文件,因此它将包含在 html 的“头部”部分中。

I also wonder what happens if i enter mutiple instances of a control (the is no InamingContainer or anything similiar).我也想知道如果我输入多个控件实例(不是 InamingContainer 或任何类似的东西)会发生什么。

This can be easily implemented using MvcScriptManager .这可以使用MvcScriptManager轻松实现。 Hope this help :)希望这有帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM