My97DatePicker日历组件在ASP.NET中的使用
- UID
- 1066743
|
My97DatePicker日历组件在ASP.NET中的使用
下面记录一般的用法,有特殊要求时可参考官网的使用文档:
首先下载组件,解压后放入自己的项目中。(也可在官网中下载)
首先在调用页面引用js:
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
调用页面aspx代码:
<span id="selectime" runat="server" style=" left: 370px; width: 315px;
top: 0px; height:37px; color:Red;">
开始时间<input name="data2" id="d5221" runat="server" class="Wdate" type="text" style="width: 83px"/>
结束时间<input name="data3" id="d5222" runat="server" class="Wdate" type="text" style="width: 89px"/>
</span >
.cs代码获取时间:
if (this.d5221.Value != null && this.d5222.Value != null && this.d5221.Value != "" && this.d5221.Value != "")
{
dataselect1 = this.d5221.Value.ToString();
dataselect2 = this.d5222.Value.ToString();
//日期时间格式:yyyy-MM-dd hh:mm:ss
date1 = Convert.ToDateTime(dataselect1);
date2 = Convert.ToDateTime(dataselect2);
cellar = this.DropDownList1.SelectedValue;
string sql = "select "+str2+" from cellardata where cellars='" + cellar + "' and sendtime between'" |
|
|
|
|
|