ASP.NET 2005 : where is Global.asax ?

J

John A Grandy

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 ......
 
J

Juan T. Llibre

A global.asax is not created by default.

Select "File", "New", "File", and select "Global Application Class"
from the templates.

Or, right-click the website's name in the Solution Explorer and select
"Add new item" and select "Global Application Class" from the templates.
 
J

John A Grandy

Ok. I was able to do that. But apparently Global.asax.cs no longer exists
.... the various methods ( Application_Start , etc. ) instead show inline in
Global.asax ...

Why did they do this ?
 
J

Juan T. Llibre

I guess they figure that, since global.asax doesn't have a UI,
writing the code inline in global.asax saves the extra step involved
in writing code into a codebehind file.

The purpose of codebehind is to separate code from UI.
Since global.asax has no UI, it doesn't need to have codebehind.

You can do anything you want inline in global.asax
that you could do in previous incarnations of codebehind global.asax.
 
B

Bruce Barker

because asp.net compiles all the source code now, not VS, so the extra file
is not required.

-- bruce (sqlwork.com)
 
Joined
Jun 13, 2009
Messages
1
Reaction score
0
Global.asax not published to IIS

I have created a web site in ASP.Net 2.0, as you told in previous message in this post i have added global.asax page and writen code in it. If i run the web site it is working fine.

I publish the site is IIS, global.asax is not working in publshed site, i saw there is no global.asax in published code in IIS. I manually copied global.asax to the published location, still it is not working.

Kindly some one help me please.
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top