Understanding event order ???

G

Guest

Dear all,

I am trying to understand postack event ordering. for that I have a web form
with a text box, listbox and button server controls.

Then I add a response.write in eaxh control event changed.
When I run my application I proceed in following order :

First I change a text in the text box
Then I select an item in the list box
And I press a Ok button

-> event order I gets are :
Page load
text changed
Item Selected
Button Clicked
Page render

thats fine, then next I change the way I use my interface by selecting first
an item in the list and then chage a text in the text box. As far as I
undrstand, events are cached so I was expecting to gets at that time the List
item selected events coming before the text change event, but I get same
order of event as before

Could any one explain ?

thnaks for your help
regards
serge
 
K

Karl Seguin

Serge:
Events won't fire in the order that they occurred on the client. Not enough
information is passed back to asp.net to determine the actual event of
orders. If you need to know the specific order, you either have to track
that yourself on the cilentside (using javascript and hidden field) or set
the autopostback=true for those controls and handle each event one at a
time.

karl
 
G

Guest

Thanks for your information, I was just curious

In general, how people handle evenst in there web application? did they
always set the Autopostback to its defualt value of false and treat them in
one shot or is there some cases where it absolutely require Autopostback to
true
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top