Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-09
4
Medium Priority
?
368 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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

885 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