I am currently using IIS to host a simple website, and would like to know how to enable the 'Global.aspx' file? I need to know where I would define it, as all the tutorials talk about using Visual Studio, which I am not using.
Asked
Active
Viewed 360 times
2 Answers
0
Just right-click on the project name displayed in the Solution Explorer, and choose Add New...
, then choose Global.asax
from the list displayed in the new popup window. It goes to the root of your application.
Here is further information: Where is the Global.asax.cs file?
-
As I said, I am not using Visual Studio, and there is no 'Solution Explorer' in IIS 7.5 – Lloyd268 Apr 03 '15 at 12:21
-
@Lloyd268 Having a site's code (even a simple one) purely in IIS is not a good idea. It's harder to develop, it doesn't let you easily have separate production vs testing environments. At the very least, you should have the code reside on a dev machine, do source code control with SVN or Git, and deploy your code when you're sure it's working to your server. Visual Studio will make that a lot easier, and there's several great free options. – mason Apr 03 '15 at 12:40
0
File Global.asax
should be placed on the root directory of your site. There is nothing else to do besides adding required code, you put it there and just work.

Claudio Redi
- 67,454
- 15
- 130
- 155
-
I have done that, however upon restarting the server, it remains blank. I thought it was meant to auto-populate? – Lloyd268 Apr 03 '15 at 12:21
-
@Lloyd268: global.asax won't autopolulate, you'll need to add content manually – Claudio Redi Apr 03 '15 at 12:31