I'm working on a Silverlight media player like you get on MySpace and other sites. The app is meant to be as simple as possible, so i've created a Silverlight-enabled WCF service which returns a list of the MP3s available in the songs directory on the server. To allow the SL app to be as loosely coupled to the location of the physical mp3s, the wcf service needs to return a list of fully qualified URIs to each mp3 in the directory. When the user selects a song to listen to we can simply set the MediaElement.Source to the URI.
The following post contains some great code (that can even be used outside of a WebForm) to convert "~/myfolder/mysubfolder" to http://foo.bar/myfolder/mysubfolder".
http://stackoverflow.com/questions/121962/determine-sites-absolute-fully-qualified-url-in-asp-net
SHARE: