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

global.asax or global.ascx?

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)
{...}
}
Nov 19 '05 #1
5 4181
..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.
"Daves" <db****@simnet.is> wrote in message
news:ek******************@TK2MSFTNGP09.phx.gbl...
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)
{...}
}

Nov 19 '05 #2
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
"Daves" wrote:
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)
{...}
}

Nov 19 '05 #3
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.
"Alien2_51" <da***************@monacocoach.removeme.com> wrote in message
news:C2**********************************@microsof t.com...
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
"Daves" wrote:
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)
{...}
}

Nov 19 '05 #4
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...
"Scott M." wrote:
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.
"Alien2_51" <da***************@monacocoach.removeme.com> wrote in message
news:C2**********************************@microsof t.com...
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
"Daves" wrote:
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)
{...}
}


Nov 19 '05 #5
Yes, I know that. But, Global.asax is considered part of the project and is
shown by default without having to "un-hide" it.
"Alien2_51" <da***************@monacocoach.removeme.com> wrote in message
news:D6**********************************@microsof t.com...
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...
"Scott M." wrote:
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.
"Alien2_51" <da***************@monacocoach.removeme.com> wrote in message
news:C2**********************************@microsof t.com...
> 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
>
>
> "Daves" wrote:
>
>> 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)
>> {...}
>> }
>>
>>
>>


Nov 19 '05 #6

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

Similar topics

6
by: martin | last post by:
Hi, I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx. However what I would like to do is have a single global resource file for the...
3
by: Robert Walter | last post by:
I want to user the Page method LoadControl inside the Global.asax.cs but when I instantiate a page and try it I get the following error... System.NullReferenceException: Object reference not set...
1
by: Asha | last post by:
i want to keep a global variable or a session in global.ascx when ever a user access this particular page. at certain time, this page will do a infinit loop, and i want to set a variable to allow...
6
by: fd123456 | last post by:
Er... Sorry to interrupt, but you CAN put methods and functions in the Global.asax file. You just have to make them static (Shared in VB). You can even use functions normally not available outside...
7
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
7
by: Jonas | last post by:
Hi! I have an Application_Error method in global.asax that uses Server.Transfer to move execution to a custom error page. This works fine when an exception is thrown in one of the aspx or ascx...
1
by: ttt.tas | last post by:
hi all, i'm using asp .net v1.1, when i publish my application on the server using xcopy, i find that the global.asax file is still there, shouldn't it be compiled and assembled?? what if i...
2
by: TARUN | last post by:
I have a question about declaring the Global.ascx: In VS.NET I create a Solution, and there are 4 projects under it. They are put under 4 folders, but web pages would be called across the 4...
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.