public static void deletepicture(int picid, string pic) { if (HttpContext.Current.Session["Type"].ToString().ToLower().Equals("admin")) { myDAL obj = new myDAL(); System.IO.File.Delete(HttpRuntime.AppDomainAppPath + "/" + pic); obj.deletepicture(picid); } }