大家帮忙看一下,我的代码哪里出了问题,怎么就是联动呢?
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddlpro" runat="server" AutoPostBack="True" DataSourceID="odspro"
DataTextField="ZoneName" DataValueField="FatherId" OnSelectedIndexChanged="ddlpro_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlCity" runat="server" DataSourceID="odsCity" DataTextField="ZoneName"
DataValueField="FatherId">
</asp:DropDownList>
<asp:ObjectDataSource ID="odspro" runat="server" SelectMethod="GetZone" TypeName="MyClass.Core.zone.ZoneClassBLL">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsCity" runat="server" SelectMethod="GetZoneByFatherId"
TypeName="MyClass.Core.zone.ZoneClassBLL">
<SelectParameters>
<asp:ControlParameter ControlID="ddlpro" DefaultValue="0" Name="fatherId" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddlpro" runat="server" AutoPostBack="True" DataSourceID="odspro"
DataTextField="ZoneName" DataValueField="FatherId" OnSelectedIndexChanged="ddlpro_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlCity" runat="server" DataSourceID="odsCity" DataTextField="ZoneName"
DataValueField="FatherId">
</asp:DropDownList>
<asp:ObjectDataSource ID="odspro" runat="server" SelectMethod="GetZone" TypeName="MyClass.Core.zone.ZoneClassBLL">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsCity" runat="server" SelectMethod="GetZoneByFatherId"
TypeName="MyClass.Core.zone.ZoneClassBLL">
<SelectParameters>
<asp:ControlParameter ControlID="ddlpro" DefaultValue="0" Name="fatherId" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
http://topic.csdn.net/u/20110225/16/1aae774d-e92e-4d1f-9065-61b712063c28.html?44405