I am working in a Silverlight control where I need to upload some static data synchronously from a XML file. The file is in my same Web Server. I can get the URI of the control like so:
HtmlPage.Document.DocumentUri.ToString();
That returns the URI with the query that shows the control inclusive:
http://example.com:8085/MyWeb/CustomPage.aspx?waid=a1a5780a8ddea6c517ae1-b4ef&nid=id78
What I need from there is only http://example.com:8085/MyWeb (which will always be the same except for the host name/port) I do not want to hard code that because this will be deployed in several servers. So, what I’d like to do is get the web site URI. I tried several things like localpath, host, AbsolutePath and others in the DocumentUri object but none seem to give me what I need. How can I do that without doing a ton of manipulation.
Thanks!
Try the following:
And finally: