Home All Groups Group Topic Archive Search About

dropdownlist selectedindex changed in code -postback?

Author
23 Jun 2005 3:42 PM
ECathell
How do I initialize a postback when I have changed the selected index through code? The dropdownlist.selectedindex event does not fire, therefore I assume I need to do a postback after I change it in my code. When I change it with the control at runtime it works fine(autopostback enabled)

--
--Eric Cathell, MCSA

Author
23 Jun 2005 6:01 PM
Harolds
Just call the code yourself, dropdownlist_selectedindex(nothing,nothing)

or better yet create another method that has the code you need to process on
selected index change and call it from both places.

Show quoteHide quote
"ECathell" wrote:

> How do I initialize a postback when I have changed the selected index through code? The dropdownlist.selectedindex event does not fire, therefore I assume I need to do a postback after I change it in my code. When I change it with the control at runtime it works fine(autopostback enabled)
>
> --
> --Eric Cathell, MCSA
Author
23 Jun 2005 6:22 PM
RichieRich
I thought you just set the AutoPostBack property of the control to true.

Show quoteHide quote
"ECathell" wrote:

> How do I initialize a postback when I have changed the selected index through code? The dropdownlist.selectedindex event does not fire, therefore I assume I need to do a postback after I change it in my code. When I change it with the control at runtime it works fine(autopostback enabled)
>
> --
> --Eric Cathell, MCSA
Author
23 Jun 2005 8:45 PM
Harolds
AutoPostBack events are triggered from the client side. ECathell wants the
event to be triggered on the server side, which means just call the code at
the point in the code you wanted the event triggered.

Show quoteHide quote
"RichieRich" wrote:

> I thought you just set the AutoPostBack property of the control to true.
>
> "ECathell" wrote:
>
> > How do I initialize a postback when I have changed the selected index through code? The dropdownlist.selectedindex event does not fire, therefore I assume I need to do a postback after I change it in my code. When I change it with the control at runtime it works fine(autopostback enabled)
> >
> > --
> > --Eric Cathell, MCSA