global.asax or global.ascx?

D

Daves

emm... what exactly is the difference?!
If I want a global file without <script></script> tags could I use
global.ascx only like

class Global
{
void Session_Start(Object sender, EventArgs e)
{...}
}
 
S

Scott M.

..ascx denotes a User Control and this file is not automatically looked at
the moment your application starts or ends or when a session begins or ends.
..asax denotes the Global Application File and this file is automatically
checked for event handlers during several different events by IIS.
 
G

Guest

global.asax.vb is the file that actually contains application and session
event handlers. You can see this file from VS.IDE by clicking the "Show All
Files" icon in the upper section of the Solution Explorer
 
S

Scott M.

In VB.NET, you don't need to "un-hide" the file in the Solution Explorer, it
is a part of the project and is shown all the time. I suspect this is the
case in C# as well.
 
G

Guest

The "Show All Files" toggles whether or not you can see files in the project
directory which are not part of the project and adds the "+" and "-" controls
to the project files in the solution explorer so you can see the code behind
and resource files...
 
S

Scott M.

Yes, I know that. But, Global.asax is considered part of the project and is
shown by default without having to "un-hide" it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top