Solved

ASP.NET - Can't get SelectedIndexChange to fire.

Posted on 2011-03-09
4
354 Views
Last Modified: 2012-05-11
I have a DDL on a standard ASP page:
   <asp:DropDownList ID="ddlReportCategoryID" runat="server" Style="width: 370px; float: left;">
   </asp:DropDownList>

Open in new window

I've attempted to associate it with with the SelectedIndexChanged event:
   Protected Sub ddlReportCategoryID_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddlReportCategoryID.SelectedIndexChanged
      MsgBox("hello")
   End Sub

Open in new window

No matter what I do, I can't get the code to fire:

- I tried making a new DDL with a couple ListItems.  SelectedIndexChanged didn't fire.
- I tried placing the DDL on a new page.  SelectedIndexChanged didn't fire.

All other ASP on the page seems to be working just fine.





0
Comment
Question by:jdana
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
adilkhan earned 250 total points
Comment Utility
try to set Autopostback  attribute to true

also...

1) Add a ComboBox
2) Add some list items by selecting the ComboBox, clicking on Items in the property grid, and then writing a couple of lines
2) Set the DropDownStyle to DropDownList
3) Double-click the ComboBox
0
 
LVL 8

Expert Comment

by:Anurag Agarwal
Comment Utility
try this

<asp:DropDownList ID="ddlReportCategoryID" runat="server" Style="width: 370px; float: left;" AutoPostBack="True" >
   </asp:DropDownList>
0
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
anurag_onnet i have already suggestion that solution.
0
 

Author Closing Comment

by:jdana
Comment Utility
adilkhan,

I love the simple solutions.  Thanks.

J
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now