ASP.NET 2005 : where is Global.asax ?

  • Thread starter Thread starter John A Grandy
  • Start date Start date
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 ......
 
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.



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
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 ?
 
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.




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
because asp.net compiles all the source code now, not VS, so the extra file
is not required.

-- bruce (sqlwork.com)
 

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

Back
Top