469,938 Members | 2,462 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Page_load before a buttonclick event function

Hi there,

I just found out that when I have a button on an aspx page and i click it,
the page_load event function executes before the button click event function.
Why is this so? I have a web form that is continually displayed. Each time
the button is clicked i want the value of a checkbox to be checked and then i
want the checkbox to be cleared when the page is reloaded. The problem is
that i thought i would clear the checkbox in the page_load function but then
when the button click event function is run the checkbox will always be a
value of false!

Is this correct?
Nov 18 '05 #1
1 1508
Hi Joshua,
This is due to the form postback. Please go through the following articles
to get a quick understanding of asp.net page lifecycle
http://www.15seconds.com/issue/020102.htm
and this one for an indepth understandin
http://msdn.microsoft.com/asp.net/us.../viewstate.asp
The best
srini

"Joshua Weir" wrote:
Hi there,

I just found out that when I have a button on an aspx page and i click it,
the page_load event function executes before the button click event function.
Why is this so? I have a web form that is continually displayed. Each time
the button is clicked i want the value of a checkbox to be checked and then i
want the checkbox to be cleared when the page is reloaded. The problem is
that i thought i would clear the checkbox in the page_load function but then
when the button click event function is run the checkbox will always be a
value of false!

Is this correct?

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Christian | last post: by
3 posts views Thread by Stevie_mac | last post: by
14 posts views Thread by V. Jenks | last post: by
4 posts views Thread by Seraph | last post: by
4 posts views Thread by Brian Mitchell | last post: by
17 posts views Thread by Arpan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.