Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6855811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:48:17+00:00 2026-05-27T01:48:17+00:00

I see in global.asax.cs from an ASP.NET MVC project protected void Application_BeginRequest() { }

  • 0

I see in global.asax.cs from an ASP.NET MVC project

 protected void Application_BeginRequest()
 {
 }

but when I try to add this to my project, I don’t see what is calling this method. I see that the base System.Web.HttpApplication has this event but I don’t see anything overriding it or subscribing to this event.

Can someone explain how you wire up Application_BeginRequest in ASP.NET MVC?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:48:18+00:00Added an answer on May 27, 2026 at 1:48 am

    I’m afraid Cos’s answer isn’t quite accurate. You don’t have to wire it up because the base HttpApplication class does it for you. There isn’t an interface or an override here; HttpApplication uses reflection to hook up these methods to the events based on the method name. So it’s a bit of convention-based magic that has been in the framework for a while. It’s very strange, and I think they only did it to maintain similarities with Classic ASP back in the day and/or provide a shortcut to avoid writing lots of small HttpModules.

    For the curious, load up HttpApplication in Reflector and hunt for the HookupEventHandlersForApplicationAndModules() method. Or, load HttpApplicationFactory and look at the ReflectOnApplicationType() and ReflectOnMethodInfoIfItLooksLikeEventHandler() (love that name!) methods.

    Rick Strahl discussed this on his blog a few years ago.

    Is it something you really need to know to use ASP.NET? No, but knowing it certainly removes some of the mystery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My base controller has this override: protected override void OnException(ExceptionContext filterContext) { // http://forums.asp.net/t/1318736.aspx
how to test 301 error in local host in asp.net.I add global.asax page and
I'm trying to learn ASP.NET MVC, so I did as test project this where
Do you see any benefit in injecting the database connnection string from the Global.asax.cs
I've upgraded from ASP.NET MVC Beta to 1.0 and did the following changes to
Here's the snippet from my Global.asax: <script runat=server> void Application_Start(object sender, EventArgs e) {
I have the following url I need to support in my asp.net mvc project
This is my RegisterRoutes method in global.asax: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute({resource}.axd/{*pathInfo});
We are attempting to integrate an ASP.NET MVC site with our client's SSO system
I'm working on an asp.net project that uses an in-house developed custom SessionStateProvider class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.