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

  • SEARCH
  • Home
  • 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 8046153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:43:12+00:00 2026-06-05T05:43:12+00:00

Framework: ASP.Net MVC 3 When a request comes in, I am intercepting the request

  • 0

Framework: ASP.Net MVC 3

When a request comes in, I am intercepting the request through a global filter and performing a database look up based on the subdomain. The return int from the DB lookup needs to be persisted to other objects (i.e. Controllers) so that the DB hit doesn’t need to be performed again whenever that data might be needed.

I was hoping to avoid using cookies since this information is a pertinent part of the system and I didn’t want to rely on cookies being enabled.

I have read the related questions here and here which have not provided any good answers.

I actually have two questions:

  1. As of now I had come up with a Subdomain manager object which does the heavy lifting and through my IoC have the manager object be HTTP Request scoped and I can grab that manager anytime during the request as a possible solution.

    Is there a better way to carry this information across different object in the MVC request pipeline after I have looked it up? – I had examined the idea of putting the information back into the request somehow (which pertains to question #2).

  2. If you were to use the Request to store the data (i.e. intercept the request, perform look up, write to the request) where would be the logical place to hold that information?

    I reviewed the session but this seems to be closely tied to the way the web server is configured for sessions and I already mentioned I don’t want to use cookies. Other areas such as post data and query string collections are locked down for their security reasons.

Any suggestions?

  • 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-06-05T05:43:13+00:00Added an answer on June 5, 2026 at 5:43 am

    1 Is pretty close.

    Your SubDomain manager could probably be a singleton (using your IOC container perhaps), with a simple static Dictionary for looking up a subdomain once the data has been initially loaded. If you are concerned about having this initial load occur and be syncd across several servers without executing the data load multiple times you could look at a distributed cache (appfabric, ncache, memcache) depending on the overhead of making the DB call.

    I would not use HttpContext.Item to store the Id however. I would use your IOC container to Inject this into your controller(s) (Property inject probably). Using most IOC containers you should be able to have this fire on the start of a HttpRequest and last last the lifetime of the “User Session/Transaction”.

    NHibernate Burrows allows all of this to be implemented so easily it’s laughable http://nhforge.org/wikis/burrow/default.aspx

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

Sidebar

Related Questions

I'm a total newbie at Entity Framework and ASP.Net MVC, having learned mostly from
How do I use Datatable instead of Entity framework in Asp.Net mvc? I'm referring
For my ASP.NET MVC 2 application I use Entity Framework 1.0 as my data
I am using the asp.net mvc with the Entity Framework. I have a list
I'm trying to learn ASP.NET MVC + Entity Framework by developing a small project.
I am developing an ASP.Net MVC 3 Web application with Entity Framework 4.1 and
I have an ASP.NET MVC 3 site that makes use of a ClientDependency framework
I am developing an ASP.Net MVC 3 Web application using Entity Framework 4.1 and
I am developing an ASP.Net MVC 3 Web application using Entity Framework 4.1, however,
I have an older asp.net mvc solution (s#arp framework) whith two projects one for

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.