473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Global.asax ?

WJ
Is the "Application_Start" event on Global.asax created by the "very first
user" who visits the Asp.Net web site ? Or is it started per user ? If it is
the first case, how do you flush the global variables without shutting down
the web site ?

Thanks

John
Nov 18 '05 #1
3 1011
Hi John,
Application_OnStart handler is executed only once in the lifetime of an
application
and not for every application instance.The application object is available
in all pages or all modules of the
application.You can add items to the Application object,For eg:
Application["test1"]="Test 1";
Once an item is added like this it is available to all pages or modules
within the application.
To remove the item added above,
Application.Remove("test1");
You can also use Clear or RemoveAll method to remove all items from a
Application state.
Application.RemoveAll(); // this will remove all items from the application
state.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com
"WJ" <Jo*******@HotMail.Com> wrote in message
news:un**************@TK2MSFTNGP09.phx.gbl...
Is the "Application_Start" event on Global.asax created by the "very first
user" who visits the Asp.Net web site ? Or is it started per user ? If it is the first case, how do you flush the global variables without shutting down the web site ?

Thanks

John

Nov 18 '05 #2
If you are using IIS5.0 with Windows 2000 server or older, in website
properties, remove and create the "Application".
If you are using Windows server 2003, stop and start the "Application Pool"
for that website from IIS console.

--
Ganesan Subramanian
Database and Datawarehousing.
"WJ" <Jo*******@HotMail.Com> wrote in message
news:un**************@TK2MSFTNGP09.phx.gbl...
Is the "Application_Start" event on Global.asax created by the "very first
user" who visits the Asp.Net web site ? Or is it started per user ? If it is the first case, how do you flush the global variables without shutting down the web site ?

Thanks

John

Nov 18 '05 #3
The runtime only invokes Application_Start once during the lifetime of
the application.

Can you tell us a bit more about your variables and what you need to
do to flush them (reinitialize them?). It could be as easy as moving
the initialization code into a different method in the Global class,
and invoking that method when an event happens where you need to reset
global state.

There is an article here that has more information about the Global
class and how it related to application state:
http://odetocode.com/Articles/89.aspx

HTH,

--
Scott

On Tue, 27 Apr 2004 22:32:13 -0400, "WJ" <Jo*******@HotMail.Com>
wrote:
Is the "Application_Start" event on Global.asax created by the "very first
user" who visits the Asp.Net web site ? Or is it started per user ? If it is
the first case, how do you flush the global variables without shutting down
the web site ?

Thanks

John


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
2
by: Steve | last post by:
I am new to this newsgroup & to .NET in general. I have been playing around with Visual Studio .NET, building and rendering web pages using VB "code behind" files. My problem / question is; How...
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
4
by: Al Santino | last post by:
Hello, I've created a simple C# web services project using Visual Studio 2005. My service compiles and runs correctly when called by remote clients. I'm able to step through the service in the...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.