How can I access the HttpServerUtility instance in ASP.NET MVC controller?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
“this.httpContext.Server” is a reference to HttpServerUtilityBase, the abstract class wrapper that’s a part of the System.Web.Abstractions DLL. You can also do:
To directly access the “old-school” way. Also you can get an instance of the base class using the wrapper by doing the following:
The wrapper class inherits from httpServerUtilityBase