Solved

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

Posted on 2011-03-09
4
356 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:
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Media.Imaging 1 18
Video Player 11 23
VB.NET 1 22
Please explain the parts of these 2 LINQ expressions 3 29
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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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