Event wireup headache

G

Guest

I've been browsing through this newsgroup and I am yet to come across exactly
the answer I was looking for so, after a while, I figured I'd searched long
enough and hard enough to actually post.

My problem is simple: I have a search control - it runs a search and
returns a number of products - these products are displayed through a user
control. When the search is run the user can decide how many results they
want to see in the results pain.

When they reach the results page there is ANOTHER drop down which allows
users to change the number of results on the page.

What I want to know - and I've not found this succinctly anywhere else yet -
is what do I do and when during the page life cycle.

Currently my page runs as this:

Init:
Read initial results per page into rpp from query string
LoadControl() & ConfigureControl() x rpp;

Load:
Does very little;

Page posts back with RPP changed:

Init: Does notion

LoadViewState:
Read rpp from viewstate of dropdown control
LoadControl & ConfigureControl x new rpp

Load:
Does very little

The net result of this is that the events that most of the events in the
controls don't fire. They just don't seem bound. Now, the fact that some
work and some don't seems to indicate that I'm mussin up my view state
somewhere.

I'm lost now so I'll leave it down to you wonderful people to ask me
pertinent questions.

Cheers,
Joshua
 
B

bruce barker \(sqlwork.com\)

its pretty simple. on postback the order is as follows

preinit
onint
load viewstate
load postback data
form load
raise events
prerender
render

for a dropdrown to fire, it must see the value change. this means you need
it inital it on onint (or let it save save in viewstate). the event handler
must be added on or before form load.

-- bruce (sqlwork.com)
 

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,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top