Page_load when I click on a button ?!

C

Christian Ista

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,
 
G

Greg Burns

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
 
B

Brian Henry

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
 
E

Eliyahu Goldin

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
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top