c# - Getting relative root in Global.Asax -
i trying store physical root , relative root of application in memory @ application startup.
i did physical path so:
//get physical root , store global.applicationphysicalpath = request.physicalapplicationpath;
but cannot relative path. have following code works, requires put in page
object:
global.applicationrelativepath = request.url.absoluteuri.replace(request.url.absolutepath, "") + page.resolveurl("~/");
thanks
in order relative path within application_start use following:
protected void application_start(object sender, eventargs e) { string path = server.mappath("/"); }
Comments
Post a Comment