我真的很难与此,我发现一个很好的日期范围选择器,使用Jquery的问题是我需要抓住已输出到按钮的文本,以便我可以查询我的sql数据库。我认为最好的方法是将jquery按钮输出到标签,然后有另一个标题为搜索的按钮来抓取已选择的日期。下面是一些代码JQuery文本标签
<head>
<link href="jquery-ui.min.css" rel="stylesheet">
<link href="jquery.comiseo.daterangepicker.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script src="moment.min.js"></script>
<script src="jquery.comiseo.daterangepicker.js"></script>
<script>
$(function() { $("#e1").daterangepicker(); });
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="e1" name="e1"><label for="no">text no</label> <<<Hoping to
add
the values from "e1 to say Value1.Text
<asp:Label ID="Label1" runat="server" Text="Label" name="e1">
</asp:Label>
</form>`
然后当我点击搜索它抓住的日期范围,并把它放到我的查询:
protected void Search_Click(object sender, EventArgs e)
{
string testdb =
ConfigurationManager.ConnectionStrings["easystone"].ConnectionString;
SqlConnection con = new SqlConnection(testdb);
SqlDataAdapter graph = new SqlDataAdapter("SELECT [User], [dateof]
FROM [dbo].[chart]where [dateof] >='"+Label1+"' and [dateof]
<='"+Label2+"'",
con);
DataTable graphdata = new DataTable();
graph.Fill(graphdata);
chart1.DataSource = graphdata;
chart1.ChartAreas["ChartArea1"].AxisX.Title = "";
}
`
你缺少问题.. – Webruster