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 6723735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:36:16+00:00 2026-05-26T09:36:16+00:00

So in my MVC 3 site I have a path ~/_Content/* mapped both to

  • 0

So in my MVC 3 site I have a path ~/_Content/* mapped both to an MVC route to serve jpgs, gifs from a database but also I have a custom VirtualPathProvider that picks up these urls and traverses a database structure to pick up Razor (and ASPX if needed) pages.

I’ve got all that working nicely – after a day trying to figure out how to get SqlCacheDependency to work with entity framework queries (an entirely other story) – I can now request Razor pages and they get compiled and executed; and they’ll get rebuilt when the underlying file changes in the database.

The next step will be to be adding additional ViewLocationFormats (et al) to my ViewEngines to support finding Views in the database.

But now I’ve got another issue: these pages need to inherit from WebViewPage or WebViewPage<TModel> in order to work with the site’s normal Layout page.

While I can obviously use @inherits I’d rather just have it ‘work’ – so, the logical thing to do is to embed a web.config in the content hierarchy which has something very similar to the one that’s in the standard ~/Views folder.

The thing is, on trying this, Asp.Net doesn’t pay any attention to that – presumably because it’s only looking for web.config files that are physically on the disk.

I can use a <location path="_content" ... directive in the site’s main web.config – but ideally I’d like to be able to have fine-grained control from the content database end as well.

How can I get Asp.Net to pick up and, ideally, auto-discover these content-managed web.configs?

  • 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-26T09:36:17+00:00Added an answer on May 26, 2026 at 9:36 am

    probably you can do very little about this, see questions and answers linked below, my main point would be that if you do not have the usual web.config in the web application folder from where do you get the connection string required to access the database? A single and default entry point for the settings is anyway required or unless you customize everything like using other text files or environment variables, you would not know how to reach and connect to the db.

    see here amyway:

    Using ConfigurationManager to load config from an arbitrary location

    Loading a different web.config file at runtime fo ASP.NET

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

Sidebar

Related Questions

I have an MVC site, secured using [Authorize] attributes, but have an issue on
I have an asp.net mvc 1.0 site that serves some content from a 2
I have an ASP.NET MVC 3 site using a custom route for specifying the
All of a sudden in this MVC site I have no views that can
i have a hosted web site and i have an asp.net mvc site. The
I am building an Asp.net MVC site where I have a fast dedicated server
I have an Asp.net Mvc site where I want to give a separate access
I have a ASP.NET MVC site using Membership Provider. I have trouble testing some
I have an ASP.NET MVC site and ELMAH is showing me that my site
I have a asp.net mvc site that references a couple of libraries. Recently I

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.