I have a pretty simple page with a GridView, a DropDownList as a filter to
the GridView, and a filter Button. Both gridview and dropdownlist are bound
to SqlDataSources. I am setting another parameter in the Selecting event of
the datasource, but the strange thing is the order of the events that fire.
When I first enter the page the event order is:
Page_Init
Page_Load
SqlDataSource.Selecting
But when I press the filter button and get a postback, the event order
changes to:
Page_Init
SqlDataSource.Selecting
Page_Load
Why would this happen? There are things that have to happen in the
Page_Load before the Selecting event happens. Its very disturbing that I
can't count on the life cycle of the page to be consistant...
Milosz Skalecki [MCAD] - 14 Feb 2008 19:05 GMT
Seems like the control referencing SqlDataSource has ViewState switched off.
It is correct?

Signature
Milosz
> I have a pretty simple page with a GridView, a DropDownList as a filter to
> the GridView, and a filter Button. Both gridview and dropdownlist are bound
[quoted text clipped - 17 lines]
> Page_Load before the Selecting event happens. Its very disturbing that I
> can't count on the life cycle of the page to be consistant...
David W - 14 Feb 2008 19:14 GMT
The page has viewstate turned off, the control doesn't explicitly have it
off. Why would this affect the order of the events? How do I fix this
without turning viewstate on?
David W - 15 Feb 2008 23:42 GMT
Can anyone shed any light on this?