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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

java - stack overflow exception on xml transformation -