asp.net DataList嵌套 & 控件绑定问题

来源:百度知道 编辑:UC知道 时间:2024/05/31 05:29:52
此时想根据dropdownListd的选定项内容从该大类里查找数据。
我现在弄不明白的就是绑定的时候如何给DropdownList加一个标识符,因为每个DDl都是一样的所以无法和类别联系起来,请各位大大赐教。
<asp:DataListID="dListFenlei"runat="server"RepeatColumns="2"RepeatDirection="horizontal"
OnDataBinding="dListFenlei_DataBinding"OnItemDataBound="dListFenlei_ItemDataBound"Width="900px">
<ItemTemplate>

http://zhidao.baidu.com/question/75471410.html?quesup1
这里有分拿。
<tablewidth="400"style="font-size:smaller;border-right:#c3d9ff2pxsolid;border-left:#c3d9ff2pxsolid;
border-bottom:#c3d9ff2pxsolid;">
<tr>
<tdcolspan="3"style="background-color:#c3d9ff;font-size:small;">
//太长了,接下补充。
<strongstyle="font-size:15px;color:#3366cc;"><ahref="xiangxi.aspx?le

Address_SelectedIndexChanged
在这里面其实就已经有那个对像了..呵呵.

不是有个object sender吗?那个就是对事件控件的引用
你用
DropDownList ddl=(DropDownListID)sender
ddl.SelectValue就是你想要的那个选中值

sender可是很强大的..

嵌套 可以用ObjectDateSorce 去帮定。和在后代绑定一样的