|
-
May 24th, 2005, 09:15 AM
#1
Thread Starter
Lively Member
Dropdownlist doesn't go to selectedindex after postback
Hi,
My dropdownlist doesn't go to selectedindex after page is
post back, any idea whats wrong with the below?
<%
If Not Page.IsPostBack Then
CategoryID.Datasource = dsCategory.DefaultView
CategoryID.EnableViewState = True
CategoryID.DataBind()
End If
%>
<% CategoryID.SelectedIndex = CategoryID.Items.IndexOf(CategoryID.Items.FindByValue(dsCategory.FieldValue("category_id", Nothing) )) %>
<asp ropDownList ID="CategoryID" DataSource='<%# dsCategory.DefaultView %>' DataTextField="name" DataValueField="id" runat="server"></asp ropDownList>
<asp:ImageButton ID="btnSubmit" AlternateText="Submit" runat="server" />
-
May 24th, 2005, 11:57 PM
#2
Lively Member
Re: Dropdownlist doesn't go to selectedindex after postback
i think an onselectindexchange to pass into your ddl may help do the job.
See this thread for more info: http://www.vbforums.com/showthread.p...t=dropdownlist
Last edited by john83; May 25th, 2005 at 12:18 AM.
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
|
Click Here to Expand Forum to Full Width
|