Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page_Load

Reply
Thread Tools

Page_Load

 
 
Tony Johansson
Guest
Posts: n/a
 
      01-11-2010
Hello!

Page_Load event is called every time a page is loaded is the documentation
saying.
I just wonder what exactly does this mean ?

If I have a request on a page and set a break point in this Page_Load it
will stop there.

//Tony



 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      01-11-2010
"Tony Johansson" <> wrote in
news:qGH2n.2$:

> Page_Load event is called every time a page is loaded is the
> documentation saying.
> I just wonder what exactly does this mean ?


It means it is called every time a page is loaded, which means every
time there is a Request from a browser.

Realistically, the pattern is:

protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
//Stuff when the page is initially loaded (GET)
}
else
{
//Stuff that runs on 100% of Postbacks (POST)
//Generally, you put code in event handlers
//not here. If you find yourself coding here
//you are probably using bad architecture.
}
}

There are other events that run every time the page is requested. NOTE:
Page_Load is for loading pages. It applies to all pages. If you have
event handlers, put conditionals there.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Materpage page_load event fired after content page_load? rockdale ASP .Net 1 11-16-2006 06:59 PM
in VB.NET Page_load of a base class called after the derived class Page_load ? z. f. ASP .Net 0 10-19-2004 12:01 PM
Page_Load or Page_Init Patrick Kristiansen ASP .Net 0 03-05-2004 06:26 PM
Why does page_load fire twice when inheriting from a common overridable Page_Load bminder ASP .Net 1 02-23-2004 08:54 PM
.ascx page_load event MeDhanush ASP .Net 1 06-25-2003 02:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57