473,566 Members | 3,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDownList events not firing

Hi there,
I have a web form with some DropDownList controls that I am
trying to trap the selection change and run the attached server code.
However, even thought the controls have the runat property set to server,
the event code does not get executed. Anyone have any ideas?
Jun 27 '08 #1
4 1452
Can you post some code ? Make sure that AutoPostBack property of
DropDownList is set to True.

--
Madhur

"Waldy" <so*****@micros oft.comwrote in message
news:OY******** ******@TK2MSFTN GP02.phx.gbl...
Hi there,
I have a web form with some DropDownList controls that I am
trying to trap the selection change and run the attached server code.
However, even thought the controls have the runat property set to server,
the event code does not get executed. Anyone have any ideas?
Jun 27 '08 #2

"Madhur" <sd*@df.comwrot e in message
news:68******** *************** ***********@mic rosoft.com...
Can you post some code ?
Not easily as it is a large project.
>Make sure that AutoPostBack property of DropDownList is set to True.
I tried that, and now the form gets posted back when a selection is made,
but the dropdown events code still does not get executed.
Jun 27 '08 #3
Please be more specific

The two comments you made contradict each other. When you make a selection,
the Dropdownlist OnselectedChang ed event is the event that's firing, to
cause the postback.

What (exactly) are you referring to when you say "dropdown events code"

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Waldy" <so*****@micros oft.comwrote in message
news:Oj******** ******@TK2MSFTN GP02.phx.gbl...
>
"Madhur" <sd*@df.comwrot e in message
news:68******** *************** ***********@mic rosoft.com...
>Can you post some code ?

Not easily as it is a large project.
>>Make sure that AutoPostBack property of DropDownList is set to True.

I tried that, and now the form gets posted back when a selection is made,
but the dropdown events code still does not get executed.

Jun 27 '08 #4
Hi David,
The two comments you made contradict each other. When you make a
selection, the Dropdownlist OnselectedChang ed event is the event that's
firing, to cause the postback.
The page is re-loaded.
What (exactly) are you referring to when you say "dropdown events code"
The OnSelectedIndex Changed code in the code behind file.
Jun 27 '08 #5

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

Similar topics

2
1972
by: Frank Rocco | last post by:
Hello, I have a DropDownList that I populate from an odbc datasource in code. When I bring up the form for editing, how do I select the value in the DropDownList based on a value stored in the database? I tried: lb1.SelectedItem.Text = dr; lb1.SelectedItem.Value = dr;
3
2279
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...
5
4385
by: bryanp10 | last post by:
I have a page that is almost entirely dynamically created. Textboxes and checkbox are working fine, firing events, and persistent their state. DropDownList is giving me a major headache. All my controls are created in CreateChildControls() for my custom control. Here's a snippet of code: DropDownList dd = new DropDownList(); dd.ID =...
1
4413
by: Paul L | last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a DropDownList control which is in the ItemTemplate of a DataList. I have made an exact copy of the DropDownList control, and placed it outside of the DataList and it fires the event just fine. So it's definitely to do with it being in a template. I've managed to...
1
3298
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 =...
2
3328
by: AdrEsqu | last post by:
I am trying to use AutoPostback to retrieve the value that was selected in my dropdownlist. The event is not firing for the dropdownlist because the datagrid is being built after the Lifecycle of the Firing Events. So in order to capture my selected value I need to capture it in the OnInit when the autopostback fires, but I don't know how...
11
5792
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
2
3286
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...
2
3734
by: MattB | last post by:
I have a (.Net 1.1) form with a Repeater and a DropDownList in the ItemTemplate. I programmatically make the DDL Autopostback = true at runtime based on the bound data. That works - I can see the postback happen appropriately. The DropDownList looks like this: <asp:DropDownList id="ddMultiQty"...
0
7673
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...
0
7584
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...
0
8109
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...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
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...
0
5213
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
926
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...

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.