我想过滤Repeater控件中的组合框。
我有这个下拉列表:
<asp:DropDownList ID="ddAcademicDegree" runat="server" Width="256px"
SelectedValue ='<%# Bind("EdLevel") %>' CssClass="GeneralFont" DataTextField="Description" DataValueField="IDNo" AutoPostBack="True" DataSourceID="SqlDataSource2">
</asp:DropDownList>
然后我想根据您在第一个下拉列表中选择的内容过滤下一个下拉列表
<asp:DropDownList ID="ddDegree" runat="server" Width="256px" SelectedValue ='<%# Bind("DegreeID") %>' CssClass="GeneralFont" DataTextField="Description" DataValueField="IDNo" DataSourceID="SqlDataSource3"> </asp:DropDownList>
我有这个查询如何使用第一个下拉列表来过滤第二个下拉列表?
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:HRIS_ConnectionString %>"
SelectCommand="select 0 as IDNo,'' as Description union all select code as IDNo,Description from degree order by idno"
ProviderName="<%$ ConnectionStrings:HRIS_ConnectionString.ProviderName %>"> </asp:SqlDataSource>
这是整个代码
<asp:Repeater ID="rptrEduc" runat="server"
OnItemCreated="rptrEduc_ItemCreated" EnableViewState="False"
onitemdatabound="rptrEduc_ItemDataBound" onitemcommand="rptrEduc_ItemCommand"
>
<ItemTemplate>
<table width ="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="20px"><asp:ImageButton ID="imgEdDelete" runat="server" onclick="imgEdDelete_Click" ImageUrl="~/IMAGES/delete_16x16.gif" OnClientClick='return confirm("Delete this record?");' /></td>
<td style="text-align: left">
Education:</td>
<td>
<asp:DropDownList ID="ddAcademicDegree" runat="server" Width="256px"
SelectedValue ='<%# Bind("EdLevel") %>' CssClass="GeneralFont" DataTextField="Description" DataValueField="IDNo" AutoPostBack="True" PropertyName="SelectedValue" DataSourceID="SqlDataSource2">
</asp:DropDownList>
</td>
<td>
Area of Study (Major)</td>
<td>
<asp:TextBox ID="txtMajor" runat="server"
Width="260px" CssClass="GeneralFontText"
Text='<%# Bind("Major") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td></td>
<td style="text-align: left">
</td>
<td>
&LT;% -
SelectedValue ='&lt;%#Bind(“DegreeID”)%&gt;' CssClass =“GeneralFont”DataTextField =“Description”DataValueField =“IDNo”&gt; - %&gt;
'CssClass =“GeneralFont”DataTextField =“Description”DataValueField =“IDNo”DataSourceID =“SqlDataSource3”&gt;
&LT;% -
SelectedValue ='&lt;%#Bind(“Degree”)%&gt;'的CssClass = “GeneralFont” &GT;
大师
学士
- %GT;
集中区(小)
“&GT;
机构名称:
“&GT;
毕业年份:
'CssClass =“GeneralFontText”&gt;