473,396 Members | 1,666 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,396 software developers and data experts.

where is global.asax.cs ?

[newbie question]
I need some global app strong typed variable.

So in my solution explorer, I did:
Add New Item | Global Application class

It add me a file Global.asax :

<%@ Application Language="C#" %>

<script runat="server">

void Application_Start(object sender, EventArgs e)
{
// Code qui s'exécute au démarrage de l'application

}

void Application_End(object sender, EventArgs e)
{
// Code qui s'exécute à l'arrêt de l'application

}

void Application_Error(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une erreur non gérée se produit

}

void Session_Start(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une nouvelle session démarre

}

void Session_End(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une session se termine.
// Remarque : l'événement Session_End est déclenché uniquement
lorsque le mode sessionstate
// a la valeur InProc dans le fichier Web.config. Si le mode
de session a la valeur StateServer
// ou SQLServer, l'événement n'est pas déclenché.

}

</script>
but I need to work on the C# corresponding class (Global.asax.cs ?) to
add some static var (and I don't like to work on scripts)
How to I get the class source? I don't see it in my explorer ?
(sorry new to .NET)

Apr 19 '07 #1
4 9414
On Apr 19, 12:32 pm, o...@linuxmail.org wrote:
[newbie question]
I need some global app strong typed variable.

So in my solution explorer, I did:
Add New Item | Global Application class

It add me a file Global.asax :

<%@ Application Language="C#" %>

<script runat="server">

void Application_Start(object sender, EventArgs e)
{
// Code qui s'exécute au démarrage de l'application

}

void Application_End(object sender, EventArgs e)
{
// Code qui s'exécute à l'arrêt de l'application

}

void Application_Error(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une erreur non gérée se produit

}

void Session_Start(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une nouvelle session démarre

}

void Session_End(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une session se termine.
// Remarque : l'événement Session_End est déclenché uniquement
lorsque le mode sessionstate
// a la valeur InProc dans le fichier Web.config. Si le mode
de session a la valeur StateServer
// ou SQLServer, l'événement n'est pas déclenché.

}

</script>

but I need to work on the C# corresponding class (Global.asax.cs ?) to
add some static var (and I don't like to work on scripts)
How to I get the class source? I don't see it in my explorer ?
(sorry new to .NET)
I think, you should create it (Add.... New Item... Class). What type
of project do you do? Usually, VS.NET creates that class file
automatically.

Apr 19 '07 #2
Are you using VS2005 and .Net 2.0? If so, read this:
http://dallas.sark.com/SarkBlog/cbol...1/14/2234.aspx

If not, press F7.

Ray at work
<ol**@linuxmail.orgwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
[newbie question]
I need some global app strong typed variable.

So in my solution explorer, I did:
Add New Item | Global Application class
but I need to work on the C# corresponding class (Global.asax.cs ?) to
add some static var (and I don't like to work on scripts)
How to I get the class source? I don't see it in my explorer ?
(sorry new to .NET)

Apr 19 '07 #3
yes thanks, VS2005 and .NET 2..

and I had been told .NET2 was more straightforward than J2EE..
Apr 19 '07 #4
You can create a static class with static members, and reference that.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

<ol**@linuxmail.orgwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
[newbie question]
I need some global app strong typed variable.

So in my solution explorer, I did:
Add New Item | Global Application class

It add me a file Global.asax :

<%@ Application Language="C#" %>

<script runat="server">

void Application_Start(object sender, EventArgs e)
{
// Code qui s'exécute au démarrage de l'application

}

void Application_End(object sender, EventArgs e)
{
// Code qui s'exécute à l'arrêt de l'application

}

void Application_Error(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une erreur non gérée se produit

}

void Session_Start(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une nouvelle session démarre

}

void Session_End(object sender, EventArgs e)
{
// Code qui s'exécute lorsqu'une session se termine.
// Remarque : l'événement Session_End est déclenché uniquement
lorsque le mode sessionstate
// a la valeur InProc dans le fichier Web.config. Si le mode
de session a la valeur StateServer
// ou SQLServer, l'événement n'est pas déclenché.

}

</script>
but I need to work on the C# corresponding class (Global.asax.cs ?) to
add some static var (and I don't like to work on scripts)
How to I get the class source? I don't see it in my explorer ?
(sorry new to .NET)
Apr 19 '07 #5

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

Similar topics

6
by: Andrea Williams | last post by:
Where is the best place to put global variables. In traditional ASP I used to put all of them into an include file and include it in every page. Will the Global.aspx.cs do that same thing? ...
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?
4
by: John A Grandy | last post by:
I installed VS05 RC , created a new Web Site , but I do not see Global.asax , and I do not see Global.asax.cs in the App_Code dir ......
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...
1
by: GaryDean | last post by:
I notice that the global.asax in v2 is inline. because of this I can't say Session = conn; The compiler will accept it but at runtime the exception says "Session State is not available in this...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.