Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Global.asax methods in Asp.net web application

Posted on 2013-10-31
3
Medium Priority
?
762 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 150 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 150 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

927 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