How can i use the server.mappath method in a C# class library class ,which acts as my BusinessLayer for My ASP.NET WEbsite
+5
A:
By calling it?
var path = System.Web.HttpContext.Current.Server.MapPath("default.aspx");
Make sure you add a reference to the System.Web assembly.
Slace
2009-07-29 11:14:32
+1
A:
You should reference System.Web and call:
HttpContext.Current.Server.MapPath(...)
Philippe Leybaert
2009-07-29 11:14:47
+1
A:
Surely you shouldn't be using Server.MapPath in your business layer. The business layer should work even if you weren't using it in a web app...
George
2009-07-29 16:54:35