Sequence of code processing

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
creation. I am using VB as a language and have VB code between script tags
at the top of my page. I also have a button on my page that runs a
Protected Sub that performs some processing when clicked as noted below:

Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnNewSubfile.Click

....

End Sub



Does this code run before the code at the top of the page or after. Or does
the code at the top of the page run at all when I click the button? Thanks.

David
 
David,
ASP.Net doesn't run in a linear fashion as classic ASP did. It's
completely event-driven. That means your button click event will be fired at
a particular time based on the design of ASP.Net, not based upon the
location of the code. Paul Wilson has a great article listing all the
various events that will occur on a page and the order in which they occur
at: http://blogs.crsw.com/mark/articles/471.aspx
 
Thank you Mark. I'll check it out.

David
Mark Fitzpatrick said:
David,
ASP.Net doesn't run in a linear fashion as classic ASP did. It's
completely event-driven. That means your button click event will be fired
at a particular time based on the design of ASP.Net, not based upon the
location of the code. Paul Wilson has a great article listing all the
various events that will occur on a page and the order in which they occur
at: http://blogs.crsw.com/mark/articles/471.aspx
 
Back
Top