Connecting Tech Pros Worldwide Forums | Help | Site Map

DropDownList in a Repeater - OnSelectedIndexChange not firing

MattB
Guest
 
Posts: n/a
#1: Oct 1 '07
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"
OnSelectedIndexChanged="ddMultiQty_SelectedIndexCh anged"
runat="server"></asp:DropDownList>

And in the codebehind I have this:

Public Sub ddMultiQty_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ddMultiQty.SelectedIndexChanged
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

Teemu Keiski
Guest
 
Posts: n/a
#2: Oct 1 '07

re: DropDownList in a Repeater - OnSelectedIndexChange not firing


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" <somedudeus@yahoo.comwrote in message
news:5mclkaFchgaeU1@mid.individual.net...
Quote:
>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"
OnSelectedIndexChanged="ddMultiQty_SelectedIndexCh anged"
runat="server"></asp:DropDownList>
>
And in the codebehind I have this:
>
Public Sub ddMultiQty_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ddMultiQty.SelectedIndexChanged
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

MattB
Guest
 
Posts: n/a
#3: Oct 1 '07

re: DropDownList in a Repeater - OnSelectedIndexChange not firing


Teemu Keiski wrote:
Quote:
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
Closed Thread