我想dropdownlist
根据Date
<asp:DropDownList ID="ddlNewJobOrder" DataTextField="name" DataValueField="value"
runat="server" AppendDataBoundItems="True" DataSourceID="NewJobOrderDS" ToolTip="New Job Order List" Width="110" AutoPostBack="True" OnSelectedIndexChanged="ddlNewJobOrder_SelectedIndexChanged">
<asp:SqlDataSource ID="NewJobOrderDS" runat="server" SelectCommand="SELECT Ref_No as name, Job_Order_ID as value FROM Job_Order WHERE Status <> 'JO_Completed' and Delivery_Date = @jaDate1 ORDER BY Ref_No" OnSelecting="NewJobOrderDS_Selecting">
<SelectParameters>
<asp:ControlParameter ControlID="JADate1" Name="jaDate1" PropertyName="Text" Type="DateTime"/>
</SelectParameters>
所以每次都Date
在变化,那么DDL
应该再次重新填充。
SqlDataSource1.SelectParameters.Remove(SqlDataSource1.SelectParameters["jaDate"]);
SqlDataSource1.SelectParameters.Add("jaDate", JADate2.Text);
但是上面的代码不起作用,在DDL
我第一次填充它后没有响应。