How do you put System.Web.HttpApplication in your app

I am trying to add System.Web.HttpApplication to my application.  Any idea how to do this.  I found an example for the Global.asax file but It will not build.  I tried following the directions here -> http://www.dotnetjunkies.com/HowTo/91EA672F-C4C9-4235-B6C5-B20DEF7808A3.dcik but it does not work.  Code is copied below.
namespace InheritingHttpApplication 
{
   public class Global : System.Web.HttpApplication
   {
      public Global()
      {
         InitializeComponent();
      } 
      protected void Application_Start(Object sender, EventArgs e)
      {
      }
      protected void Session_Start(Object sender, EventArgs e)
      {
      }
      protected void Session_End(Object sender, EventArgs e)
      {
      }
      protected void Application_End(Object sender, EventArgs e)
      {
      }
   }
}

Open in new window

LVL 2
CipherISAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ororioleCommented:
What do you mean it does not build? Do you get a compiler error? What is the error?

Did you create a Global.asax file or just paste this code into a .cs file named something else? You need to add a Global.asax file to your project and use it. It will create the above file for you. You can then extend it like in his example but there needs to be a Global.asax file in your project if you want to do this.

You add a Global.asax file by selecting Add New Item, then select Global Application Class.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anurag ThakurTechnical ManagerCommented:
the example never mentioned it to be a global.asax class
he just mentioned that have you seen something like this and you can build something like that easily by inheriting from HttpApplication class

just add a normal class and inherit it from the HttpApplication class as shown by the sample
i tried it and its working as suggested
0
ororioleCommented:
ragi0017,
  Please do not double post. You repeated the information the user already gave us. He said the example is not working for him. I gave a solution to get him up and running. It is true that this can be done without a global.asax file; however, if you had read the article you would see that the author does indeed refer to global.asax.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.