all groups > asp.net > january 2006 >
You're in the

asp.net

group:

ResolveUrl in a static helper method


Re: ResolveUrl in a static helper method: Found it! Edwin Knoppert
1/11/2006 2:50:45 PM
asp.net:
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


"Lloyd Dupont" <net.galador@ld> schreef in bericht
news:Ok5F6QrFGHA.3728@tk2msftngp13.phx.gbl...
[quoted text, click to view]

Re: ResolveUrl in a static helper method: Found it! Luke Dalessandro
1/11/2006 7:23:11 PM

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

[quoted text, click to view]
ResolveUrl in a static helper method Lloyd Dupont
1/11/2006 11:33:53 PM
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...

--
I have taken a vow of poverty. If you want to really piss me off, send me
money.

Re: ResolveUrl in a static helper method: Found it! Lloyd Dupont
1/11/2006 11:37:54 PM
HttpContext.Current.Server.MapPath("~/App_Data")

seems to do the trick!!!

[quoted text, click to view]

Re: ResolveUrl in a static helper method: Found it! Lloyd Dupont
1/12/2006 10:16:08 AM
interesting...

[quoted text, click to view]
AddThis Social Bookmark Button