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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:06:02+00:00 2026-05-21T17:06:02+00:00

I need to map the path of a folder in my ASP MVC project

  • 0

I need to map the path of a folder in my ASP MVC project from within another project in the solution. My model is in another class library. I have referenced System.web but I cannot seem to find Server.MapPath. <– Im not certain this is the way to do this in MVC

So my question is: What namespaces need to be included in my model’s project and how does one map to folder in the web application in MVC?

Thanks a bunch!

  • 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-21T17:06:03+00:00Added an answer on May 21, 2026 at 5:06 pm

    The type you’re referring to is HttpServerUtilityBase (typically called via Server.MapPath), but HttpRequestBase also has a MapPath method (typically called through Request.MapPath). These are part of ASP.NET 4’s System.Web.dll. Note that the concrete implementations of these are HttpServerUtilityWrapper and HttpRequestWrapper. But in general, you would never create instances of those. Instead, use instances that you obtain from the ControllerContext.

    The question though is why does your model project need to call this? You might want to avoid having your model have a dependency on these types. Ideally you’d just pass the value in when you create your model. Another approach is to create your own lightweight interface for locating file paths and have your model depend on that.

    But not knowing why you need it, I can only speculate. 🙂 If you have a good reason to use these classes, you’ll need to pass in an instance of one or the other into your model class so it can call it.

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

Sidebar

Related Questions

I have a solution with an ASP.NET project and a Class library project where
I have a single-page JavaScript application, held within an ASP.NET MVC 3 website. In
I have a map custom view that inherit from MKOverlayPathView. I need this custom
I need to map a class which has a list of Enums to a
I have custom map image with specific height and width. i need to map
I have a simple requirement, i need a map of type . however i
I have a number, say 123456, and I need to map it to a
i need to serialize directory tree. i have no trouble with this type: std::map<
I have an MVCArray to store my polyline path in, but I need to
I am in the need to create sub-folders within another website on the same

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.