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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -