The OP was asking, "If so, what is the difference between the Page_Load and
the <% %code at the top of an aspx page?" -- not whether he should be using
codebehind vs. inline code.
The difference is that Page_Load is an intrinsic *event* in the ASP.NET page
lifecycle (there are many others), whereas the <% %code at the top of an
aspx page is called the Page declaration, which sets up the details of the
page class, what class it uses, and other features that each have attributes
you can set.
-- Peter
Recursion: see Recursion
site:
http://www.eggheadcafe.com
unBlog:
http://petesbloggerama.blogspot.com
BlogMetaFinder:
http://www.blogmetafinder.com
"to*********@gmail.com" wrote:
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.