有两个表
一个是表Leibie 字段为 leibie_id,leibie_name
另一个表Lanmu 字段为 lanmu_id,leibie_id,lanmu_name
然后页面上有两个DropDownList控件
用第一个显示Leibie中的内容 用第二个显示Lanmu中的内容
请问怎么写代码将它们关联起来
也就是点击第一个的时候 然后第二个里面出现和它相联系的内容???
请帮一下忙,谢谢了!!!!哪位大哥帮忙把代码写的具体一点
小弟不胜感激!!!!
一个是表Leibie 字段为 leibie_id,leibie_name
另一个表Lanmu 字段为 lanmu_id,leibie_id,lanmu_name
然后页面上有两个DropDownList控件
用第一个显示Leibie中的内容 用第二个显示Lanmu中的内容
请问怎么写代码将它们关联起来
也就是点击第一个的时候 然后第二个里面出现和它相联系的内容???
请帮一下忙,谢谢了!!!!哪位大哥帮忙把代码写的具体一点
小弟不胜感激!!!!
解决方案 »
- 为什么查询时获取到0呢? 但在首次显示信息时都没错 却在查询条件未选时却选择了0
- Attributes.Add 能否添加 e参数的对象
- 这样子的SQL语句要怎么写?
- *********************请问2003操作系统下怎么让w3pwp.exe进程运行在我指定的帐户下********************
- 听说这是一个功能很强的源码
- 一个错误页面的导向问题.
- 自己做的自定义 控件能否定义多个事件?? 不只是 Click事件
- 在winform中控件绑定数据后,可以多选数据,如图所示,使用的哪个控件,或者这个如图所示功能,怎么实现
- 如何在自制控件中執行某控件事件時調用Web中的一個過程?
- 求教WORD问题
- 谁帮忙写一下代码?
- 求DataGrid的排序问题,,很简单的!!!!!
我点击第一个dropdownlist的时候选中第二项后
为什么页面刷新后仍然回到第一项上
<FONT face="宋体">
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 256px; POSITION: absolute; TOP: 96px"
runat="server" AutoPostBack="True"></asp:DropDownList>
<asp:DropDownList id="DropDownList2" style="Z-INDEX: 102; LEFT: 256px; POSITION: absolute; TOP: 160px"
runat="server"></asp:DropDownList></FONT>
</form>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Not Me.IsPostBack Then
Dim a As New ArrayList
Dim i As Integer
For i = 0 To 5
a.Add(i)
Next
Me.DropDownList1.DataSource = a
Me.DropDownList1.DataBind()
End If
End Sub Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim b As New ArrayList
Dim x As String
Dim i As Integer
For i = 0 To 10
b.Add(i & Me.DropDownList1.SelectedValue)
Next
Me.DropDownList2.DataSource = b
Me.DataBind()
End Sub
记得DropDownList1 AutoPostBack="True"
我点击第一个dropdownlist的时候选中第二项后
为什么页面刷新后仍然回到第一项上
要在page_load中加上 if not ispostback
end if