SelectedIndexChanged not firing for dropdownlist

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 23
Reputation: blackbr is an unknown quantity at this point 
Solved Threads: 0
blackbr blackbr is offline Offline
Newbie Poster

SelectedIndexChanged not firing for dropdownlist

 
0
  #1
Apr 30th, 2009
For some reason, selectedindexChanged vb.net code is no longer firing. autopostback and enable viewstate are sill true. Enabled is set to true in code behind. Using VS2008.

Any idea on what can cause this?

Thanks,
Randy

  1. <asp:DropDownList id="ddlEmpName2"
  2. style="Z-INDEX: 138; LEFT: 192px; POSITION: absolute; TOP: 32px" runat="server" Width="152px" ForeColor="DarkBlue" DataValueField="EmployeeId" DataTextField="EmpLastFirst" DataSource="<%# dvEmpActiveList %>"
  3. Font-Size="X-Small" AutoPostBack="True" Enabled="False"
  4. AppendDataBoundItems="True"
  5. <asp:ListItem Selected="false" Text="Select" Value="0"></asp:ListItem>
  6. </asp:DropDownList>
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #2
Apr 30th, 2009
Whats your code for capturing the change on the dropdown?
Please mark this post as 'Solved' if it has helped and fixed your issue.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 23
Reputation: blackbr is an unknown quantity at this point 
Solved Threads: 0
blackbr blackbr is offline Offline
Newbie Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #3
Apr 30th, 2009
Thanks for the quick response,ninjaimp.
The session variable was set up to try to hold the info for the update, but the method does NOT fire

Public Sub ddlEmpName2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlEmpName2.SelectedIndexChanged
SelectedEmpId = ddlEmpName2.SelectedValue
Session("ddlEmpName2Session") = ddlEmpName2 '[4-29-2009]
lblOrgNameShort_DataBinding(Me, e)
SetActiveOrg(drOrg)
End Sub
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 11
Reputation: tonym001 is an unknown quantity at this point 
Solved Threads: 0
tonym001 tonym001 is offline Offline
Newbie Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #4
May 1st, 2009
Hi Randy

There is no event selected in the HTML - runat Server is good but what sub are you going to call.

I think you have probably copied this control from another page - been there done it. Try double clicking the control and you should be fine.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 23
Reputation: blackbr is an unknown quantity at this point 
Solved Threads: 0
blackbr blackbr is offline Offline
Newbie Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #5
May 1st, 2009
Originally Posted by tonym001 View Post
Hi Randy

There is no event selected in the HTML - runat Server is good but what sub are you going to call.

I think you have probably copied this control from another page - been there done it. Try double clicking the control and you should be fine.
Tony,
This was existing logic. When I double-click on the control, it creates the selectedIndexChanged sub, but does NOT reference the sub in the aspx file -- I guess because it's using the default name.

I have another ddl on the page, and it works correctly, though it does NOT have autopostback set. It also does not mention the sub in the aspx.

I'm still open to suggestions...
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 11
Reputation: tonym001 is an unknown quantity at this point 
Solved Threads: 0
tonym001 tonym001 is offline Offline
Newbie Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #6
May 1st, 2009
Copy the code for the control, delete the control, save all, close the project, open the project, add the control back in again, put the code back in (after clicking) and then try it again.

If that does not work you will have to recreate the page from scratch.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 11
Reputation: tonym001 is an unknown quantity at this point 
Solved Threads: 0
tonym001 tonym001 is offline Offline
Newbie Poster

Re: SelectedIndexChanged not firing for dropdownlist

 
0
  #7
May 1st, 2009
PS - Otherwise you could be searching the net for days
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC