|
|
|
start date: Tue, 31 Jul 2007 19:02:54 +1000,
posted on: microsoft.public.dotnet.framework.aspnet.webcontrols
back
| Thread Index |
|
1
Rob
|
|
2
Teemu Keiski
|
SelectedIndexChanged not event firing on DropDownList when changed programatically
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
Date:Tue, 31 Jul 2007 19:02:54 +1000
Author:
|
Re: SelectedIndexChanged not event firing on DropDownList when changed programatically
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
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Rob" wrote in message
news:uSxG5K10HHA.6072@TK2MSFTNGP03.phx.gbl...
> 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
>
>
Date:Wed, 1 Aug 2007 20:28:40 +0300
Author:
|
|
|