Solved

Global.asax methods in Asp.net web application

Posted on 2013-10-31
3
674 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now