C# 如何格式化JQuery日期选择器
我已经成功安装了JQuery日期选择器(),但默认情况下它是透明的 我找到了这个网站,它提供css文件来格式化选择器: 我想要使用的皮肤是“cangas.datepicker.css”,可以在这里找到: 我遇到的问题是我不擅长css,我不知道如何实现css。我正在用.NETMVC4.5编程 我的观点是这样的:C# 如何格式化JQuery日期选择器,c#,asp.net-mvc,razor,C#,Asp.net Mvc,Razor,我已经成功安装了JQuery日期选择器(),但默认情况下它是透明的 我找到了这个网站,它提供css文件来格式化选择器: 我想要使用的皮肤是“cangas.datepicker.css”,可以在这里找到: 我遇到的问题是我不擅长css,我不知道如何实现css。我正在用.NETMVC4.5编程 我的观点是这样的: @model GRM_Reports.Models.ReportsModel @{ ViewBag.Title = "Index"; Layout = "~/Views/Sh
@model GRM_Reports.Models.ReportsModel
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<link type ="text/css" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery- ui.css" />
<link href="~/Content/themes/latoja.datepicker.datepicker.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js" ></script>
<h2>Reports</h2>
@using (Html.BeginForm("Submit", "Report", FormMethod.Post))
{
@Html.TextBox("MyDate", Model.ReportDate)
@*<input type="text" id="MyDate" style="border:solid" />*@
<table>
<tr style="font-weight:bold">
<td>
Report Name
</td>
<td>
Number Of Rows
</td>
<td>
Number Of Errors
</td>
<td>
Run Report
</td>
<td>
Message
</td>
</tr>
@for (int i = 0; i < Model.ReportList.Count; i++)
{
<tr>
<td>
@Html.DisplayFor(modelItem => Model.ReportList[i].ReportName)
@Html.HiddenFor(modelItem => Model.ReportList[i].ReportName)
</td>
<td>
@Html.DisplayFor(modelItem => Model.ReportList[i].NumberOfRows)
@Html.HiddenFor(modelItem => Model.ReportList[i].NumberOfRows)
</td>
@*<td>
@Html.DisplayFor(modelItem => Model.ReportList[i].NumberOfErrors)
@Html.HiddenFor(modelItem => Model.ReportList[i].NumberOfErrors)
</td>*@
<td>
@if (Model.ReportList[i].ReportName != "Risk Metrics - MS1 VAR" && Model.ReportList[i].ReportName != "Risk Metrics - MS2")
{
@Html.CheckBoxFor(modelItem => Model.ReportList[i].checkBox)
@Html.HiddenFor(modelItem => Model.ReportList[i].checkBox)
}
</td>
<td>
@Html.DisplayFor(modelItem => Model.ReportList[i].ResultMessage)
</td>
</tr>
}
<tr>
<td colspan="4">
<button type="submit" id="Submit_Button_Click">Submit Request</button>
</td>
</tr>
</table>
}
</div>
<script type="text/javascript">
$(function () {
$('#MyDate').datepicker();
});
</script>
@model GRM_Reports.Models.ReportsModel
@{
ViewBag.Title=“Index”;
Layout=“~/Views/Shared/_Layout.cshtml”;
}
报告
@使用(Html.BeginForm(“提交”、“报告”、FormMethod.Post))
{
@文本框(“MyDate”,Model.ReportDate)
@**@
报告名称
行数
错误数
运行报告
消息
@对于(int i=0;iModel.ReportList[i].ReportName)
@Html.HiddenFor(modelItem=>Model.ReportList[i].ReportName)
@DisplayFor(modelItem=>Model.ReportList[i].NumberOfRows)
@Html.HiddenFor(modeleItem=>Model.ReportList[i].NumberOfRows)
@*
@DisplayFor(modelItem=>Model.ReportList[i].NumberOfErrors)
@Html.HiddenFor(modelItem=>Model.ReportList[i].NumberOfErrors)
*@
@if(Model.ReportList[i].ReportName!=“风险度量-MS1 VAR”&&Model.ReportList[i].ReportName!=“风险度量-MS2”)
{
@CheckBoxFor(modelItem=>Model.ReportList[i].checkBox)
@Html.HiddenFor(modeleItem=>Model.ReportList[i].checkBox)
}
@DisplayFor(modelItem=>Model.ReportList[i].ResultMessage)
}
提交请求
}
$(函数(){
$('#MyDate').datepicker();
});
谁能告诉我如何将cangas.datepicker.css文件链接到datepicker
多谢各位 首先。将css文件添加到css文件夹中 第二,替换:
<link href="css/latoja.datepicker.css" rel="stylesheet">
<link type ="text/css" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery- ui.css" />
与:
<link type ="text/css" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery- ui.css" />
<link href="css/cangas.datepicker.css" rel="stylesheet">
我们在JQuery CSS之后导入自定义CSS的原因是为了不重写规则。(如果对同一个元素应用两个规则,则后面的规则优先)。我的问题是这一行:
<link type ="text/css" href="//code.jquery.com/ui/1.10.4/themes
我更改了代码。见上面,但我仍然是透明的。有什么想法吗?你认为我的线路有问题吗:我不知道。我不知道你是怎么安排的。然而,我要说的是,上面这句话肯定有问题。在“/jquery-”和“ui.css”之间有许多空格,这些空格是我粘贴代码时出现的。它们不存在于真正的代码中。