ResolveUrl in a static helper method

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...
 
E

Edwin Knoppert

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
 
L

Luke Dalessandro

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
 
L

Lloyd Dupont

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top