473,782 Members | 2,436 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 3749
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
1571
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
2468
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
9641
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
9480
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
10146
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
10080
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
5378
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.