Solved

Global.asax methods in Asp.net web application

Posted on 2013-10-31
3
713 Views
Last Modified: 2013-11-05
Experts,

I have just created a new Asp.net web application and could not find "Application_AuthenticateRequest" and "Application_AuthorizeRequest" methods in Global.asax.cs file but can see other methods Session_Start,Session_End,Application_Start,Application_End and Application_Error methods.

The Global.asax.cs file is inheriting from System.Web.HttpApplication and if I go to definition and can see "public event EventHandler AuthenticateRequest" and "public event EventHandler AuthorizeRequest" as events.

How can I add "Application_AuthorizeRequest and Application_AuthenticateRequest"
methods to the Global.asax.cs file?

Thanks in Advance
0
Comment
Question by:ksd123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Accepted Solution

by:
Mrunal earned 50 total points
ID: 39613804
Hi
You can directly add those two methods directly in same file.
protected void Application_BeginRequest(object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(object sender, EventArgs e)
{

}

Open in new window

After that add debugger for these functions, check whether execution pointer comes there or not.
0
 

Author Comment

by:ksd123
ID: 39613828
I can add those methods directly , but  just wondering I can't see the methods using intellisense ? Any idea ?
0
 
LVL 41

Assisted Solution

by:guru_sami
guru_sami earned 50 total points
ID: 39614621
They are not in intellisense but mainly work based on convention. You can add handler for an application level Event by using Application_eventname.

Check these:
msdn.microsoft.com/en-us/library/fwzzh56s(v=vs.100).aspx
http://msdn.microsoft.com/en-us/library/system.web.httpapplication_events.aspx
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question