Deep Linking Between Lightswitch HTML and Silverlight Clients

Update 7 Nov 2013: This article is now out-of-date, since the LightSwitch HTML Client now has built-in support for deep-linking. 


Suppose you have both a Silverlight client and an HTML client in your Lightswitch project, and you’d like to be able to navigate between them. In particular, from the Silverlight client you’d like to be able to navigate directly to a particular screen and entity in the HTML client, and vice versa.

One way to accomplish this have a home screens in both clients which look at the parameters passed in the URL and redirect to the appropriate screen and entity. So to navigate to Account Id 100 on the AccountDetail screen of your Silverlight Client, you could go directly to the URL:

Similarly, to navigate to the ViewAccount screen of your HTML Client, you could go to the URL:

You can download a sample project here.

The essential code is in the created method of the HTML Client’s home screen:

myapp.Home.created = function (screen) {
    // current navigation action hasn't completed, so we need to
    // fire other navigation actions after a timeout
    setTimeout(function () {
        // parse the URL to get the 'screen' and 'id' parameters, if present
        var screenName = dotnetlore.utils.getUrlParameter('screen'),
            id = dotnetlore.utils.getUrlParameter('id');

        // depending on these parameters, redirect to the appropriate screen and entity
        if (screenName === 'ViewAccount' && id > 0) {
            myapp.activeDataWorkspace.ApplicationData.Accounts_SingleOrDefault(id).execute().then(function (data) {
                if (data && data.results && data.results[0]) {
    }, 0);

and in the InitializeDataWorkspace method of the Silverlight client’s Home screen:

string screenName;
string idString;
QueryStringHelper.TryGetValue("screen", out screenName);
QueryStringHelper.TryGetValue("id", out idString);
if (screenName != null)
	if (screenName == "AccountDetail")
		int id;
		int.TryParse(idString, out id);
		if (id != null)


6 thoughts on “Deep Linking Between Lightswitch HTML and Silverlight Clients

  1. Hi Jewel,

    Nice tip but I have a problem with your solution. When I click on the button from my command bar of the HTML Client to go on the Silverlight Client, I have this error : “Load operation failed for query ‘GetAuthenticationInfo’. The remote server returned an error: NotFound.”.

    Can you help me please?

    Thank you in advance.

    • I’ve never encountered that error myself, so I’m not sure what to suggest.

      Is the silverlight client the startup client?
      Does it work if you enter the URL directly in your browser instead of clicking the button?
      Is authentication off for your Lightswitch app?
      There are a number of MSDN forum posts on that issue, see here:

      Also, there was an issue with DevExpress XtraReports that caused that error:

      • My startup client is the HTML client and I use forms authentication. When I enter the URL directly I have the same error.

        I will see the links that you recommend.
        Thank you.

  2. I am trying to get deep-linking to work on my application. The first error I get while deep linking to HTML Client is:

    The DOM/scripting bridge is disabled.

    Also when HTML CLient is a startup client, the application is unable to find ‘dotnetlore’

    Appreciate your comments/guidance here.

    Thanks a lot

Comments are closed.