.net中,ajaxpro2.dll 实现下拉列表的二级联动,然后获取其内容

来源:百度知道 编辑:UC知道 时间:2024/09/19 16:16:12
在VS2005中,用ajaxpro2.dll组件实现了下拉列表的二级联动,一个类别,一个子类别,为什么用dropdownlist2.selecteditem.text不能获取其选定的内容

在客户端绑定数据的吧,dropdownlist就有可能获取不到数据,可以说这是微软部分控件的bug,没把客户端数据写到viewstate中,你可以在客户端取数据后传到后台,也可以在客户端把数据写到相应的viewstate中,具体这么些?跟踪下吧!

你的代码? 这个组件是很简单的。

你看看我以前写的。
html:
下拉列表1: <asp:DropDownList ID="ddlLendDepartment" runat="server">
</asp:DropDownList>

下拉列表2: <asp:DropDownList ID="ddl_LendPeople" runat="server">
<asp:ListItem Value="0">-------请选择------</asp:ListItem>
</asp:DropDownList>

function get_Result_CallBack(response)
{
if (response.value != null)
{

document.all("ddl_LendPeople").length=0;
document.all("ddl_LendPeople").options.add(new Option("-------请选择------",""));
var ds = response.value;