Solved

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

Posted on 2011-03-09
4
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
Saqib Khan earned 250 total points
ID: 35088773
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
ID: 35092015
try this

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

Expert Comment

by:Saqib Khan
ID: 35092590
anurag_onnet i have already suggestion that solution.
0
 

Author Closing Comment

by:jdana
ID: 35095197
adilkhan,

I love the simple solutions.  Thanks.

J
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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