Get The URL For the Page Serving Your Silverlight App
Dorothy was right - there's no place like home.
I needed to use a different connection string for database access, depending on what host was serving my Silverlight application. Here's how to do it:
For VB:
Imports System.Windows.Browser Dim url As String = HtmlPage.Document.DocumentUri.ToString()For C#:
using System.Windows.Browser; string url = HtmlPage.Document.DocumentUri.ToString();