Developer Forum »
Server.MapPath in OnAfterUpdate etc.
20 posts

On a traditional site I usually do Server.MapPath in order to get the physical path of a website.

This works fine in the Template files of Webnodes - but not in the methods of generated WAF_Custom files since  OnAfterUpdate etc. are executed by (Workflow?) threads without any HttpContext.

So my question is - how can I find the physical path in OnAfterUpdate() method?

I've looked around in WAF.Engine.WAFRuntime - but I haven't been able to locate it.. :)




UPDATE: I was able to use WAFRuntime.ContextSession.Engine._startupLocalPath 

120 posts

Use: WAF.Presentation.Web.WAFContext.PathFromRootToAppFolder

This property is available in all thread contexts!


20 posts




36 posts

I also wonder if there is a method to get the website root URL in the workflow context. I know its not web context so if I want any web-related stuff there I would need to pass it (e.g. when triggering a workflow from web app context). In my scenario the workflow will be run by the webnodes scheduler.

120 posts



Should work in any context, also workflow.