473,769 Members | 6,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDownList in a Repeater - OnSelectedIndex Change not firing

I have a (.Net 1.1) form with a Repeater and a DropDownList in the
ItemTemplate. I programmaticall y 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:DropDownLi st id="ddMultiQty "
OnSelectedIndex Changed="ddMult iQty_SelectedIn dexChanged"
runat="server"> </asp:DropDownLis t>

And in the codebehind I have this:

Public Sub ddMultiQty_Sele ctedIndexChange d(ByVal sender As Object,
ByVal e As System.EventArg s) Handles ddMultiQty.Sele ctedIndexChange d
DoStuff()
End Sub

Setting a breakpoint on the declaration of the sub shows it never fires
when I changed the selected indexes of my repeated DDLs. Can anyone
point out why? Thanks!

Matt
Oct 1 '07 #1
2 3748
Hi,

do you initially databind the Repeater inside If Not Page.IsPostBack Then
check? Point is that if you databind in Page_Load on every request, that
prevents postback events of child controls (of the Repeater) from firing.
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"MattB" <so********@yah oo.comwrote in message
news:5m******** ****@mid.indivi dual.net...
>I have a (.Net 1.1) form with a Repeater and a DropDownList in the
ItemTemplate . I programmaticall y make the DDL Autopostback = true at
runtime based on the bound data. That works - I can see the postback happen
appropriatel y.
The DropDownList looks like this:

<asp:DropDownLi st id="ddMultiQty "
OnSelectedIndex Changed="ddMult iQty_SelectedIn dexChanged"
runat="server"> </asp:DropDownLis t>

And in the codebehind I have this:

Public Sub ddMultiQty_Sele ctedIndexChange d(ByVal sender As Object,
ByVal e As System.EventArg s) Handles ddMultiQty.Sele ctedIndexChange d
DoStuff()
End Sub

Setting a breakpoint on the declaration of the sub shows it never fires
when I changed the selected indexes of my repeated DDLs. Can anyone point
out why? Thanks!

Matt

Oct 1 '07 #2
Teemu Keiski wrote:
Hi,

do you initially databind the Repeater inside If Not Page.IsPostBack Then
check? Point is that if you databind in Page_Load on every request, that
prevents postback events of child controls (of the Repeater) from firing.

I am, so that must be the issue. Problem is, it's very dynamic data that
I want to keep as fresh as possible. I'll try a different approach.
Thanks for the tip!

Matt
Oct 1 '07 #3

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

Similar topics

1
1939
by: Jay | last post by:
I have dropdownlist in a usercontrol and selectedindexchange event captured. But Iam seeing fire twice. Thanks.
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,...
4
4831
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:
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.
0
1535
by: Luis Esteban Valencia | last post by:
Hello. I have a datagrid with one row. I have a button that adds a new row. I am trying to implement that when the user selects one product it must change the price on the quantity column. Anyway when the user selects the first dropdownlist the dropdownselected_indexchanged is firring but when the user chagnes the second dropdownlist its not firing. aahh! if the user selects any of both dropdownlist the datagrid stays with only one row?...
3
1527
by: Mark Rae | last post by:
Hi, Apologies, but I appear to be having a senior moment... I have a standard DropDownList webcontrol with a SelectedIndexChanged event, as follows: <asp:TableCell ColumnSpan=4 VerticalAlign=Middle> Select your delivery location: <asp:DropDownList ID="cmbShipping" Runat="server"
1
1570
by: =?iso-8859-1?B?R2VhcvNpZA==?= | last post by:
Hi, Wierd problem. Using ASP.NET 2.0. Have a DropDownList - <asp:DropDownList ID="DropDownListMake" runat="server" CssClass="selectComparison" AutoPostBack="True" OnSelectedIndexChanged="DropDownListMake_SelectedIndexChanged" />
4
1462
by: Waldy | last post by:
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?
3
2467
by: E. Kwong | last post by:
I have a DropDownList which is originally bound to a SqlDataSource. In Design view, the control is shown as "Databound". Later I changed my mind and changed the dropdown binded to a datatable programmatically. In Design view, the control is shown as "Unbound". The poblem is: after the change, the SelectedIndexChanged event no longer fires. Any clue to why this happening? I'm using vb.net, VS2005. Thanks.
0
9589
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
10211
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
10045
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
9863
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...
0
8872
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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
6673
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
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.