473,659 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SelectedIndexCh anged event of a DropDownList sometimes not firing

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 SelectedIndexCh anged event code of an Asp.Net DropDownList changes text
in an adjacent TextBox by either concatenating SelectedItem.Te xt (from the
DropDownList) if it is not in the TextBox, or removing it if it is in the
TextBox. This generally works very well.

The problem occurs when I click on the TextBox, and add some text manually.
When I return to the DropDownList (click on the list), the list drops down,
then goes right back up *without* firing the SelectedIndexCh anged event. On
the next click, the list again behaves normally (i.e., the list drops down,
and I can select an entry). (But note that if I had just clicked on the
TextBox without adding text and then return to the DropDownList, all goes
well.)

Any advice appreciated....

- Lew
Nov 19 '05 #1
3 2293
Lew Barnesson < le*****@century tel.net > wrote:

<snip>
note that if I had just clicked on the TextBox without adding text and
then return to the DropDownList, all goes well.)


This makes me wonder... does the textbox do autopostback when its text is
changed? If so, it would fire and could be messing up your DropDownList
event.
Nov 19 '05 #2
Jeff,

Thanks. That's the answer! But, I need AutoPostBack on that control, so
guess I'll have to work around it (maybe in Page_Load :-) ). -Lew

"Jeff Evans" <jwevans1@you_e ye_you_see.edu> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Lew Barnesson < le*****@century tel.net > wrote:

<snip>
note that if I had just clicked on the TextBox without adding text and
then return to the DropDownList, all goes well.)


This makes me wonder... does the textbox do autopostback when its text is
changed? If so, it would fire and could be messing up your DropDownList
event.

Nov 19 '05 #3
Jeff,

Turns out I don't need AutoPostBack for that control. Now all is working.
Thanks for your help! - Lew

"Lew Barnesson" <le*****@centur ytel.net> wrote in message
news:jo******** ************@ce nturytel.net...
Jeff,

Thanks. That's the answer! But, I need AutoPostBack on that control, so
guess I'll have to work around it (maybe in Page_Load :-) ). -Lew

"Jeff Evans" <jwevans1@you_e ye_you_see.edu> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Lew Barnesson < le*****@century tel.net > wrote:

<snip>
note that if I had just clicked on the TextBox without adding text and
then return to the DropDownList, all goes well.)


This makes me wonder... does the textbox do autopostback when its text is
changed? If so, it would fire and could be messing up your DropDownList
event.


Nov 19 '05 #4

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

Similar topics

3
9760
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
3051
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.
4
4825
by: George | last post by:
I'm using .NET framework 1.1 and VS.NET 2003 for a aspx web form. There is a DropDwonList on the page and its SelectedIndexChanged event is fired to the server normally, until when I add another form "FormDummy" onto the main form, and then the event no longer fires again when the user change the value of the drop down list. Can anybody help ? Thanks so much! The aspx code is as follows:
2
5493
by: rdb | last post by:
VB.NET web program with a webform w/2 dropdownlistboxes, set to AutoPostBack TRUE, selection in either dropdown fires the SelectedIndexChanged events correctly UNTIL I navigate to second webform in the same project, THEN use the Back button to return to first webform; then changing the selection of the second dropdownlistbox fires the SelectedIndexChanged event for the FIRST dropdownlistbox. I realize that a) using an eventhandler for...
1
3329
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"),...
5
2527
by: Victorious1 | last post by:
Why doesn't the the SelectedIndexchanged event for my dropdownlist ever get executed? Why do I get a page not found error when I select a new item? My dropdownlist is within a form. The items for the dropdownlist are added at form load by a procedure. Autopostback is set to true, and viewstate is enabled. I have placed a stop at the first line of code for the SelectedIndexChanged event and I have determined that the code is not...
2
3295
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...
11
36967
by: J055 | last post by:
Hi I have a dropdown control which is constructed in another dropdown control SelectedIndexChanged event protected void ddlParamType_SelectedIndexChanged(object sender, EventArgs e) { // some other code DropDownList ddlGroups = new DropDownList(); ddlGroups.SelectedIndexChanged += new
7
12062
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
8428
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
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
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...
0
8628
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
6181
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
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.