borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (what is the differences between ado and ado.net ?)Next Topic (trying to create a login form) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : when and how many times the application_onstart fire in asp.net ?
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon when and how many times the application_onstart fire in asp.net ?

please tell me in detail.

01-01-2004 at 12:23 PM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: when and how many times the application_onstart fire in asp.net ?

The Application_Start Event fires only once in an ASP.NET application. The handling of the Event is within the Global asax file. Each ASP.NET Application can contain an optional Global asax file.. This file is compiled once on the first invocation of the application. The Global asax file is compiled into a .NET class whose base class is the HttpApplication class.
This event will not file again during the lifecycle of the application unless

1)The Application is restarted or
2) Modifications are carried out on the Global asax file, in Which case the Global asax file is recompiled and the Application_start event fired when the first request is made.

Here is a script example in which the number of visitors is counted and display using this Event,

<script language="C#" runat="server">

void Application_Start(object sender, EventArgs e) {
    Application.Lock()
    Application("Visitors") += 1
    Application.UnLock()
    Context.Response.Write(Application("Vistors"))

}
</script>





____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

02-01-2004 at 07:37 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : when and how many times the application_onstart fire in asp.net ?
Previous Topic (what is the differences between ado and ado.net ?)Next Topic (trying to create a login form) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder