473,394 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 1607
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: z. f. | last post by:
Hi, i have a class that is derived from System.Web.UI.Page, and this is the class i use in my application as PageBase. all other page classes are deriverd from my PageBase instead of the...
3
by: Christian | last post by:
hi, what is the difference between the Page_Load() and OnLoad() event handlers. do they originate from a different point ?
3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
0
by: Dailan | last post by:
Hi, I create a tree view. Each node has link button associate with it, which includes add, edit, delete buttons. The way I did is for users who have very low capablity of using computer. Now I...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
0
by: gce | last post by:
Hi, I have a aspx that I like to show the session("tfm") in a label on page_load. The value that is shown then is the old (initial value and not the updated value). When I make a button and the...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
4
by: Brian Mitchell | last post by:
How do you fire a toolbar ButtonClick event manually (for a specified button)? I have a toolbar with 4 buttons on it and I want to fire one of the button events when the user clicks a different...
17
by: Arpan | last post by:
When a Button is clicked in a Web Form in an ASPX page, the Form will post back to itself. Under such circumstances (i.e. when a Button is clicked), will the Page_Load sub execute first & then will...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.