簡體   English   中英

使用ASP.NET TextBox控件篩選SharePoint ListView WebPart

[英]Using ASP.NET TextBox Control to filter SharePoint ListView WebPart

我有一個需要過濾的SharePoint ListView WebPart。 我正在使用一個ASP.NET下拉列表控件和兩個ASP.NET texbox( TextMode="Date" )。 這三個元素的選定值將發送到用於過濾列表的參數。 下拉列表工作正常,並進行相應的過濾,問題出在文本框。 我猜它在Chrome中可以正常工作,因為Chrome可以識別type="date" ,但IE並非如此。

這是我的相關代碼,如果需要更多代碼,請告訴我:

 <div class="startDate" style="float:left; margin-left:4px">
   <asp:Label AssociatedControlID="startDateBox" Text="Start Date" BackColor="Aqua" Font-Size="X-Large" ID="startLabel">Start Date</asp:Label>
   <asp:TextBox Text="" ToolTip="From" AutoPostBack="true" runat="server" TextMode="Date" ID="startDateBox" CausesValidation="true"></asp:TextBox>
</div>
<div class="endDate" style="float:left; margin-left:4px">
   <asp:Label AssociatedControlID="endDateBox" ToolTip="To" Font-Size="X-Large" ID="endLabel">End Date</asp:Label>
   <asp:TextBox AutoPostBack="True" runat="server" TextMode="Date" ID="endDateBox" CausesValidation="True" AutoCompleteType="Enabled" ValidateRequestMode="Enabled" Text=""></asp:TextBox>
</div>

我在這里可以做什么? 我想念什么? 提前致謝。

IE不支持Date TextMode,因此使用這些HTML5屬性的IE無法使用Date TextMode。 您可以使用JQuery UI Date Picker作為替代,請檢查下面的示例。

 <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { $( "#datepicker" ).datepicker(); } ); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> 

另外,您可以從此鏈接查看更多詳細信息https://jqueryui.com/datepicker/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM