Search code examples
c#server.mappath

Server.Mappath in C# classlibrary


How can i use the server.mappath method in a C# class library class ,which acts as my BusinessLayer for My ASP.NET WEbsite


Solution

  • By calling it?

    var path = System.Web.HttpContext.Current.Server.MapPath("default.aspx");
    

    Make sure you add a reference to the System.Web assembly.