0
Server is property under "System.Web.UI" namespace and class is "Page". So are you sure that here we are using Page class (Inherit) of "System.Web.UI" namespace.
When we are working on .aspx.cs page that time this *.aspx.cs inherits System.Web.UI.Page class so we get Server.MapPath.
So please make sure that in your page you are using System.Web.UI.Page.
***************************************************************
Hi,
As per my understanding you are using Server.MapPath in your static method so Server.MapPath will not come in static method.
Please check your method should not be static where you are using Server.MapPath.