65.9K
CodeProject is changing. Read more.
Home

Get The URL For the Page Serving Your Silverlight App

starIconstarIconstarIconstarIconstarIcon

5.00/5 (3 votes)

Apr 20, 2010

CPOL
viewsIcon

27058

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();


Get The URL For the Page Serving Your Silverlight App - CodeProject