Welcome Guest Search | Active Topics | Members | Log In | Register

Page_Load or page top code Options · View
tomisarobot@gmail.com
Posted: Friday, October 05, 2007 7:49:14 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 05/10/2007 07:49:14
Date: Fri, 05 Oct 2007 14:49:14 -0700

page load runs every time assuming nothing is broken.

separating code from the ASP/HTML presentation is considered better
organization, which is why you should use your code behind file.

I don't know how the code at the top of the page works in relation to
the event structure to be honest.

David C
Posted: Friday, October 05, 2007 11:32:56 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 05/10/2007 11:32:56
Date: Fri, 5 Oct 2007 16:32:56 -0500

Can someone tell me if the code in the Page_Load sub runs every time...even
on PostBack? If so, what is the difference between the Page_Load and the <%
%> code at the top of an aspx page? Thanks.

David


Mark Rae [MVP]
Posted: Saturday, October 06, 2007 12:12:13 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 06/10/2007 00:12:13
Date: Fri, 5 Oct 2007 23:12:13 +0100

<tomisarobot@gmail.com> wrote in message
news:1191620954.315365.308450@g4g2000hsf.googlegroups.com...

> page load runs every time assuming nothing is broken.

Correct, though any code inside Page_Load (and all the other Page_xxx
methods) can be prevented from running at postback by using the IsPostBack
page method...

> separating code from the ASP/HTML presentation is considered better
> organization, which is why you should use your code behind file.

Not true at all. Inline code or code-behind is simply a matter of personal
perference - it makes not the slightest difference to functionality, or to
the compiler...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.042 seconds.