2012年3月28日水曜日

ResolveUrl equivalent from web service

Hi,I need to resolve a relative URL (eg "~/path/to/file") from within a web service. The only way I know how is using Control.ResolveUrl (or ResolveClientUrl) but obviously neither of these are available from outwith a control context. I've had a look with Reflector at what goes on in those methods and it all uses internal classes so I don't know how I can emulate it.Any ideas? I'm sure theres a method for this somewhere I just need it pointed out!CheersRory

try:

HttpContext.Current.Server.MapPath("~") + "/App_Data/TestFile.jpg", ImageFormat.Jpeg);


Thanks for the reply but I don't see how thats going to help me.

Maybe I wasn't clear enough but I need a Url I can return to the browser. ie From "~/path/to/file" I want to get "/MyApp/path/to/file"


sorry, not much of client side guy myself. I thought you were trying to resolve ~ in a web service to a real path

0 件のコメント:

コメントを投稿