-
Lost selection from dropdownlist after postback???
I have 2 dropdownlists on a formview. The list of the second one (ddl_2) is depend on the selected value of the first one (ddl_1). I use a client callback function (GetDDL2List) on event OnChange to retrieve the list for the second one. After I selected for a value from the first one list of the second come out correctly. After I make a selection from the second one and submit (post back) the form, however, the selection of the second one is lost.
<asp ropDownList ID="ddl_1" Runat="server" DataSourceID="ods_1" DataValueField="cde_item" DataTextField="txt_item" OnDataBound="ddl_1_DataBound" onchange="GetDDL2List(this.value, 'ddl'); " />
<asp:ObjectDataSource ID="ods_1" Runat="server" TypeName="Proj1.Test" SelectMethod="GetList1"
</asp:ObjectDataSource>
<asp ropDownList ID="ddl_2" Runat="server" DataSourceID="ods_2" DataValueField="cde_tem" DataTextField="txt_item" OnDataBound="ddl_2_DataBound" />
<asp:ObjectDataSource ID="ods_2" Runat="server" TypeName="Proj1.Test" SelectMethod="GetList2"
<SelectParameters>
<asp:ControlParameter Name="sGroup" ControlID="ddl_1" DefaultValue="-1" Type="string" />
</SelectParameters>
</asp:ObjectDataSource>
Similar Threads
-
By Rocksoft in forum ASP.NET
Replies: 1
Last Post: 03-08-2007, 11:36 AM
-
By Tomzen in forum ASP.NET
Replies: 1
Last Post: 12-18-2006, 10:47 AM
-
By umarani in forum ASP.NET
Replies: 1
Last Post: 07-10-2006, 06:42 PM
-
By umarani in forum ASP.NET
Replies: 0
Last Post: 06-30-2006, 05:25 AM
-
Replies: 5
Last Post: 05-06-2006, 10:22 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks