如何通过ASP.NET中的另一个下拉列表过滤下拉列表值,c#
|
我有一个关于过滤器的简单问题.
但我想只显示所选特定项目的数据值. 它是ASP.NET 4.0,C#后面和MySQL数据库使用. 解决方法查看以下链接以填充级联下拉列表.http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx http://www.codeproject.com/KB/aspnet/CascadingDropDown.aspx http://www.aspsnippets.com/Articles/Creating-Cascading-DropDownLists-in-ASP.Net.aspx 码: <table>
<tr>
<td>First</td>
<td><asp:DropDownList ID="DDLFirst" runat="server" AutoPostBack="true"
onselectedindexchanged="DDLFirst_SelectedIndexChanged"></asp:DropDownList></td>
</tr>
<tr>
<td>Secord</td>
<td><asp:DropDownList ID="DDLSecond" runat="server" AutoPostBack="true"
onselectedindexchanged="DDLSecond_SelectedIndexChanged">
<asp:ListItem Text="Select" Value="Select"></asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td>Thrid</td>
<td><asp:DropDownList ID="DDLThird" runat="server"><asp:ListItem Text="Select" Value="Select"></asp:ListItem> </asp:DropDownList></td>
</tr>
</table>
//代码背后 }
}
protected void DDLFirst_SelectedIndexChanged(object sender,EventArgs e)
{
if (DDLFirst.SelectedIndex > 0)
{
string FirstDDLValue = DDLFirst.SelectedItem.Value;
// below your code to get the second drop down list value filtered on first selection
}
}
protected void DDLSecond_SelectedIndexChanged(object sender,EventArgs e)
{
if (DDLSecond.SelectedIndex > 0)
{
string SecondDDLValue = DDLSecond.SelectedItem.Value;
// below your code to get the third drop down list value filtered on Second selection
}
} (编辑:长春站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net中XML如何做增删改查操作
- asp.net – 获得“System.Web.Mvc.Html.MvcForm”一页
- asp.net下文件上传和文件删除的代码
- asp.net – 为什么HttpContext.Current.User.Identity.Name
- 如何在asp.net会员中手动更改密码?
- Asp.NetCore1.1版本去掉project.json后如何打包生成跨平台包
- asp.net-mvc – 在布局视图中获取当前的ApplicationUser
- ASP.NET web.config中数据库连接字符串connectionStrings节
- ASP.NET中下载文件的几种实例代码
- asp.net-core – 在asp.net vnext中使用Startup.cs中的Conf
