473,486 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Page_load when I click on a button ?!

Hello,

On a page I have a button, I treat the event click of this button. Is it
normal before I treat the method myButton_click I pass throught the
Page_load event ?

That's mean what, when I start the page ... Page_load .. normal when I click
on the button Page_load again anf after myButton_click

Christian,
Nov 18 '05 #1
4 1499
Yes it is normal.

Wrap your code in the Page_load event that you only want to execute once in
and If block

If Not Page.IsPostBack Then

End If

"Christian Ista" <ml@cista.be> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
Hello,

On a page I have a button, I treat the event click of this button. Is it
normal before I treat the method myButton_click I pass throught the
Page_load event ?

That's mean what, when I start the page ... Page_load .. normal when I
click
on the button Page_load again anf after myButton_click

Christian,

Nov 18 '05 #2
Yes, it is normal. In ASP.NET pages are not persistent. When a request
comes, the server builds the page, emits the resulting HTML to the browser
and disposes the page. When you click a button, another request is sent to
the server and server build the page again.

Eliyahu

"Christian Ista" <ml@cista.be> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
Hello,

On a page I have a button, I treat the event click of this button. Is it
normal before I treat the method myButton_click I pass throught the
Page_load event ?

That's mean what, when I start the page ... Page_load .. normal when I click on the button Page_load again anf after myButton_click

Christian,

Nov 18 '05 #3
yes that is normal because you are posting back to the server and reloading
the page... use
the IsPostBack function to determin if its a postback or a new page load to
ignore any thing you dont want processed on a postback
"Christian Ista" <ml@cista.be> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
Hello,

On a page I have a button, I treat the event click of this button. Is it
normal before I treat the method myButton_click I pass throught the
Page_load event ?

That's mean what, when I start the page ... Page_load .. normal when I click on the button Page_load again anf after myButton_click

Christian,

Nov 18 '05 #4
Its is normal, check out about ASP.NET Page life cycle. You will be able to
understand clearly why it is happening. Check out this article,
http://www.15seconds.com/Issue/020102.htm

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Christian Ista" <ml@cista.be> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
Hello,

On a page I have a button, I treat the event click of this button. Is it
normal before I treat the method myButton_click I pass throught the
Page_load event ?

That's mean what, when I start the page ... Page_load .. normal when I click on the button Page_load again anf after myButton_click

Christian,

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
1868
by: thejackofall | last post by:
Hi. I have a button called btnSelect on a web form. There is a handler for it. However, the Page_Load() gets called before the handler gets called. I want to do the following. In the...
0
1604
by: Itai | last post by:
Background: I have four Web Form pages with respective C# code behind files, all in the same project: localhost/vpath1 Page1.aspx Page2.aspx
2
2523
by: Frank Schumacher | last post by:
Hi Folks, I have a problem with the order of events fired by ASP.NET. I found many articles which explaining the lifecycle of a site, but I found none which took the event from a Control on the...
3
8703
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
12
17351
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
17
2817
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...
5
1471
by: Jason Huang | last post by:
Hi, In my ASPNet 2.0 C# web application Form1.aspx, there are 1 TextBox control txtBox1, 1 Button control Btn1, and 1 GridView control GV1. I found whenever I click the Button control Btn1, then...
0
7100
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
7126
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
7175
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...
1
6842
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...
0
7330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.