473,756 Members | 4,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(O bject sender, EventArgs e)
{...}
}
Nov 19 '05 #1
5 4205
..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******** **********@TK2M SFTNGP09.phx.gb l...
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(O bject 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(O bject 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******** *************** ***********@mic rosoft.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(O bject 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******** *************** ***********@mic rosoft.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(O bject 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******** *************** ***********@mic rosoft.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******** *************** ***********@mic rosoft.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(O bject 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
2635
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 site. The resources in this global resource file will possibly change quite often, there I guess this rules out using web.config as every time web.config alters the application is recompiled, also I am not sure of the possible consequences of...
3
3017
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 to an instance of an object. at System.Web.UI.UserControlParser.GetCompiledUserControlType(String virtualPath, String inputFile, HttpContext context) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at...
1
1357
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 it to only loop how many times i want. e.g 3 times and quit. how can i get this done?
6
670
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 of a page, like LoadControl, like this : in an aspx code-behind file, for instance in the Page_Load handler : System.Web.UI.Page p = this; bool IsLoaded = Global.GlobalMethod(ref p);
7
5226
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 folder are using this code of url rewrite project is running completely fine on localhost but after uploading first page (http://emailware.net.temporary.domain.name/user/index.aspx) is fine but as i click 123 Easy-CD Ripper
7
2348
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 files. The errorpage.aspx uses Server.GetLastError() and shows a friendly error page. But when it happens in global.asax itself, the Server.Transfer does not work. Do I have to use some kind of special exception handling for exception in...
1
282
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 deleted it, will the assembly files contain any data for event handling tat was in global.asax. i'll also be thankful if anyone can tell me some resource where i can find details for such an issue.
2
2059
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 projects. For example, web page Page1 in Project1 will redirect to web page Page2 in Project2 which will further redirect to Page3 in project3 and Page4 in Project4 and finally back to Page1. In each web page, some session variables, such as...
8
13207
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 compiles & runs fine locally, but when I copy to the production machine, I get this error: Parser Error Message: Could not load type 'Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Global" %> Source...
0
9886
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9722
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8723
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.