这是我正在使用的aspx代码。我正在使用Bootstrap 3,今天早上刚刚下载了最新版本。有点新意,请耐心等待:)。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<br />
<link href="Content/datepicker.css" rel="stylesheet" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtDate" CssClass="datepicker" class="form-control" runat="server" ></asp:TextBox>
</div>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="Scripts/bootstrap-datepicker.js"></script>
<script src="Scripts/bootstrap-datepicker.min.js"></script>
<script type="text/javascript">
$('.datepicker').datepicker({
});
</script>
</body>
</html>
答案 0 :(得分:0)
bootstrap-datepicker docs显示了这样一个例子:
<div class="input-append date">
<input type="text" value="12-02-2012">
<span class="add-on"><i class="icon-th"></i></span>
</div>
尝试将输入附加日期类放在封闭的div标签
中