ResolveUrl in a static helper method

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

When I want some app resources I usually write something like:
MapPath(ResolveUrl("~/App_Data/MyResource"))

How could I do the same thing in a static helper method?
I mean MapPath & ResolveUrl are instance method of Page, so a static method
can't use them...
 
Server and url seem to relate but don't.
Server seems to be obtainable at all time, resolveurl is context related.

Server:
Dim p As New System.Web.UI.Page
p.server.mappath(...
p.dispose
 
Also see HostingEnvironment in the System.Web.Hosting namespace. At some
point you'll probably want to take a look at VirtualPathUtility from
System.Web too.

Luke
 
interesting...

Luke Dalessandro said:
Also see HostingEnvironment in the System.Web.Hosting namespace. At some
point you'll probably want to take a look at VirtualPathUtility from
System.Web too.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top