473,763 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dropdownlist selectedindexch anged 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 SelectedIndexCh anged 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 9782
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********@yah oo.com> wrote in message
news:q4******** ************@gi ganews.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 SelectedIndexCh anged 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********@yah oo.com> wrote in message
news:q4******** ************@gi ganews.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 SelectedIndexCh anged 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********@yah oo.com> wrote in message
news:q4******** ************@gi ganews.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 SelectedIndexCh anged 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
386
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 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.
2
3055
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 set to True on the DropDownList. Is there something I'm missing? Any help would be greatly appreciated.
1
1726
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 As System.EventArgs) _ HandlesInputPub.SelectedIndexChange Dim PubNew, AdTypeNew As Strin ComboBoxLostFocus(InputPub PubNew = ComboBoxCurrentCode(InputPub AdTypeNew = ComboBoxCurrentCode(AdType SetComboBoxText(AdType, "ADTP", msPubSave.Value,...
2
3049
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.. only the labels (caption) and the invisible literal controls are binded.. Now based on the invisible literal control values I get the information from DB to bind it with each dropdown list (I am doing this in the item databound event) Also based on...
3
2303
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 Asp.Net DropDownList changes text in an adjacent TextBox by either concatenating SelectedItem.Text (from the DropDownList) if it is not in the TextBox, or removing it if it is in the TextBox. This generally works very well.
1
3357
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 grdNewVideos_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdNewVideos.ItemCreated If e.Item.ItemType = ListItemType.EditItem Then AddHandler CType(e.Item.FindControl("ddlArtistNames"),...
11
5815
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
2
3305
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 details first. The DropDownList is actually a custom control called DropDownListWithCommandEvent that inherits from DropDownList. The reason I have created this is to create a DropDownList that will bubble a Command event to the containing...
7
12066
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 fact I fill this list dynamically. I use the following code:
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.