如何在部分视图中加载 JavaScript CSS 个文件
How to load JavaScript CSS files in partial view
我有一个局部视图页面,我想在这个局部视图中加载 JavaScript 和 CSS 个文件。
请帮我看看我该怎么做?
我想在局部视图中加载这三个文件
<link href="~/AdminTheme/BootstrapJalaliDatePicker/css/bootstrap-
datepicker.min.css" rel="stylesheet" />
<script src="~/AdminTheme/BootstrapJalaliDatePicker/js/bootstrap-
datepicker.min.js"></script>
<script src="~/AdminTheme/BootstrapJalaliDatePicker/js/bootstrap-
datepicker.fa.min.js"></script>
局部视图:
<div class="col-md-12">
<div class="col-md-6">
<div class="form-group">
<label asp-for="StartDate" class="control-label">
StartDate
</label>
<input id="sdDate" class="Date form-control" name="stDate"/>
<span asp-validation-for="StartDate" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="EndDate" class="control-label">
EndDate
</label>
<input id="edDate" class="Date form-control" name="edDate"/>
<span asp-validation-for="EndDate" class="error"></span>
</div>
</div>
</div>
<script type="text/javascript" language=javascript>
$(document).ready(function() {
$('.Date').datepicker({ dateFormat: "yy/mm/dd", isRTL: true,
showButtonPanel: true });
});
</script>
得到的解:
$(document).on("focusin",".Date", function () {
$(this).datepicker({
dateFormat: "yy/mm/dd",
isRTL: true,
showButtonPanel: true
});
});
添加css:
.datepicker{z-index:1151 !important;}
我有一个局部视图页面,我想在这个局部视图中加载 JavaScript 和 CSS 个文件。
请帮我看看我该怎么做?
我想在局部视图中加载这三个文件
<link href="~/AdminTheme/BootstrapJalaliDatePicker/css/bootstrap-
datepicker.min.css" rel="stylesheet" />
<script src="~/AdminTheme/BootstrapJalaliDatePicker/js/bootstrap-
datepicker.min.js"></script>
<script src="~/AdminTheme/BootstrapJalaliDatePicker/js/bootstrap-
datepicker.fa.min.js"></script>
局部视图:
<div class="col-md-12">
<div class="col-md-6">
<div class="form-group">
<label asp-for="StartDate" class="control-label">
StartDate
</label>
<input id="sdDate" class="Date form-control" name="stDate"/>
<span asp-validation-for="StartDate" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="EndDate" class="control-label">
EndDate
</label>
<input id="edDate" class="Date form-control" name="edDate"/>
<span asp-validation-for="EndDate" class="error"></span>
</div>
</div>
</div>
<script type="text/javascript" language=javascript>
$(document).ready(function() {
$('.Date').datepicker({ dateFormat: "yy/mm/dd", isRTL: true,
showButtonPanel: true });
});
</script>
得到的解:
$(document).on("focusin",".Date", function () {
$(this).datepicker({
dateFormat: "yy/mm/dd",
isRTL: true,
showButtonPanel: true
});
});
添加css:
.datepicker{z-index:1151 !important;}