Firing of events

S

sacred

I am having great difficulty with the way .net is firing
events.

Currently is is going like this.

AutoPostBack = False
Events = Change for a dropdownlist

Person does the following:
Change the dropdownlist selection
Clicks on form submit buttons.

Page Process does this:
Excutes Page_Load routine
Excutes the Change event for dropdownlist

I want it to go like this.

AutoPostBack = False
Events = Change for a dropdownlist

Person does the following:
Change the dropdownlist selection
Clicks on form submit buttons.

Page Process does this:
Excutes the Change event for dropdownlist
Excutes Page_Load routine


In Other words I would like the change event for the
dropdownlist to fire first before the page_load event
without having to have autopostback set to true.

The list box is a sorting feature for displaying of
information and autopostback set to true would just upset
them.
 
R

Rajiv R

Hi Sacred,

Firstly, scenario one: After page_load, the submit
button's event handler will execute and not the change
eventhandler of dropdownlist.

If AutoPostBack is false for dropdownlist, on change by
user, a request is NOT sent to the server. which means the
change event handler is never called on the server (the
form is not submitted to the server either).

Regarding an event handler running before page_load, I
feel you must spend sometime to understand the asp.net
page life cycle and the significance of each step.
http://www.15seconds.com/issue/020102.htm
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnaspp/html/aspnet-pageobjectmodel.asp
http://www.aspalliance.com/PaulWilson/Articles/?id=6

Hope they help!

Cheers!
Rajiv. R
 

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
474,077
Messages
2,570,568
Members
47,204
Latest member
abhinav72673

Latest Threads

Top