DropDownList SelectedIndexChanged event not firing when in a panel

P

Paul Lacey

When dynamically placing dropdownlists inside a panel, the
dropdownlist's SelectedIndexChanged event doesn't fire. If you take
the dropdownlist out of the panel it works properly. Autopostback is
set to True on the DropDownList. Is there something I'm missing? Any
help would be greatly appreciated.
 
D

DagoFlores

Is the same problem that I have, it works fine outside of the Panel,
but not inside... I'm trying with ListBox webserver controls.

Dago.
 
G

Guest

Maybe you didn't wire the event? In C# we added the following code to the
Page_Load event:

DropDownList dl3 = new DropDownList();
dl3.Items.Add("5");
dl3.Items.Add("6");
dl3.Items.Add("7");
dl3.AutoPostBack = true;
dl3.SelectedIndexChanged += new
System.EventHandler(this.dl3_SelectedIndexChanged);
Panel1.Controls.Add(dl3);

It actually worked without any problems. Hth.

Kind regards,
Nikander & Margriet Bruggeman
 

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

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top