473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

dropdownlist selectedindexchanged event not firing.. please help.


I have a dynamically created composite server control.

The composite control contains a dropdownlist, a validator and a label.

I have the dropdownlist AutoPostBack set to true and have defined a handler
for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event
is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan

Nov 17 '05 #1
3 9749
Is it because the SelectedIndex to begin with is 0? So if you pick the first
item, the SelectedIndex doesn't change and the event won't fire. Can you set
the SelectedIndex to -1 when you load the dropdown?

I had the same problem once and that is how I got around it.

-Darrin
"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

I have a dynamically created composite server control.

The composite control contains a dropdownlist, a validator and a label.

I have the dropdownlist AutoPostBack set to true and have defined a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #2
Is it because the SelectedIndex to begin with is 0? So if you pick the first
item, the SelectedIndex doesn't change and the event won't fire. Can you set
the SelectedIndex to -1 when you load the dropdown?

I had the same problem once and that is how I got around it.

-Darrin
"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

I have a dynamically created composite server control.

The composite control contains a dropdownlist, a validator and a label.

I have the dropdownlist AutoPostBack set to true and have defined a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #3
I have the same problem. Even when I preset to select index to 2,3,4 etc
when rendering the page. Was your problem related to the fact the the select
index was initialzied to 0? Have you found a solution?

"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

I have a dynamically created composite server control.

The composite control contains a dropdownlist, a validator and a label.

I have the dropdownlist AutoPostBack set to true and have defined a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DesignerX | last post by:
I have a dynamically created composite server control. The composite control contains a dropdownlist, a validator and a label. I have the dropdownlist AutoPostBack set to true and have defined...
2
by: Paul Lacey | last post by:
When dynamically placing dropdownlists inside a panel, the dropdownlist's SelectedIndexChanged event doesn't fire. If you take the dropdownlist out of the panel it works properly. Autopostback is...
1
by: ProSAAP | last post by:
I need help. I am attaching both the html stuff as well as the code snippet that is not firing. Can someone please help me Thank Sub InputPub_SelectedIndexChanged(ByVal sender As Object, ByVal e...
2
by: Shiju Poyilil | last post by:
Hi ! I have a requirement wherein i am binding a datalist which contains a label (Caption for the field) and some literal hidden fields and a dropdown list. When I am binding to the datalist.....
3
by: Lew Barnesson | last post by:
Hi All, I have looked and looked for an answer to the following problem (without success), and would be very grateful for a solution. The problem: The SelectedIndexChanged event code of an...
1
by: CurlyFro | last post by:
i have a userControl (.ascx) that has a dropdownlist embedded in a datagrid. the dropdownlist autopostback is set to true. why isn't the selectedIndexChanged firing? Private Sub...
11
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
2
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some...
7
by: Damien | last post by:
Hi guys, I'm trying to learn ASP.NET and got a problem with DroDownList... SelectedIndexChanged doesn't fire. Maybe you'll be able to suggest something. I think it may be connected with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.