DropDownList in a Repeater - OnSelectedIndexChange not firing

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

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_SelectedIndexChanged"
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
 
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top