使用bootstrap + select2的时候,select2无法应用bootstrap的样式,这样界面非常难看~
解决方案:使用select2的皮肤theme,下载并引入css文件。https://github.com/berkan52/select2-bootstrap4-theme
配置:theme: "bootstrap4"。
.net core中 “ViewDataDictionary”不包含采用 0 个参数的构造函数
正确的使用方法如下:
@await Html.PartialAsync("PartialAsync", Model, new ViewDataDictionary(ViewData) { { "Data", "Data" } })
分部视图调用:
@ViewData["Data"]