SelectedIndexChanged not event firing on DropDownList when changed programatically

R

Rob

Hi,

We have a custom control which contains a number of dropdownlists. Within
the custom control class we have a handler for the SelectedIndexChanged
event. This event fires when the user selects an item from the dropdownlist,
but it's not firing when we change the selected value in the custom
control's properties. It changes the selected value successfully, but no
event is fired.

In addition to this, changing the selection in one dropdownlist causes the
available selections in the other dropdownlist to change. This is working
successfully, however, when I attempt to access the new list, I'm unable to
because it's still holding the old values.

Can anybody tell me what I might be doing wrong. Unfortunately I can't
provide any code snippets because I'm writing this post from home

Thanks
 
T

Teemu Keiski

Hi,

that's by design if I understand your description correctly. ASP.NEt throws
events only based on user interaction, e.g when user has changed the
selection on the browser e.g at client. But if you change it
programmatically (in server-side code), no event is fired.

It's explained in

ASP.NET Web Server Control Event Model
http://msdn2.microsoft.com/en-us/library/y3bwdsh3.aspx
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top