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
Solved

Global.asax methods in Asp.net web application

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 - Windows Protected Your PC 7 41
Updating specific fields only in MVC/Entity controller 2 18
Open a link in vb.net 2 16
Amazon S3 .Net error 5 16
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.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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