none
Show LightSwitch HTML app (VS2013) inside SharePoint 2010 and 2013

    Question

  • Hi guys,

    I am using the latest version of LightSwitch (VS2013). I want to create a HTML app that will be showed in both SharePoint 2010 and 2013 on-premise. I know that SharePoint 2010 and 2013 development and deployment models are very different. I also know that the new business app template in visual studio could help me create and integrate a HTML app inside SP2013 and that such scenario is not possible in SP2010. I am aware that LS uses the authentication provided by SP2013 and that this is not possible with SP2010. Not to mention the fact that the latest LightSwitch apps use .net framework version that is above 3.5 which is the supported version in SharePoint 2010.
    I tried to use the Page Viewer web part inside SP 2010 and 2013 and to show my app inside an iFrame but that didn't work - I got the login page but once I put my credentials and clicked the LOG IN button nothing happened.
    Does anybody have any experience with such scenario?

    Regards,
    Martin
    Wednesday, October 23, 2013 6:30 AM

Answers

  • Firstly,  because of the oAuth in 2013 apps, you need to 'enable sharepoint' in your LS app and then it won't work on SP2010.  So you'll likely have to deploy the same app once with SP enabled for 2013 and again without sp enabled for 2010.

    But say you have a LS HTML app in which sharepoint is not enabled, you can display the app in an iFrame.  I tried this with Page Viewer and Content Editor on a web part page and, like you found, it doesn't work.  The errors in F12 are all in the .js of LS app as if the iframe is an earlier version of IE. 

    I was able to get it to work in a page saved to a document library on 2010 (not a web part page, so it doesn't have all the sp stuff on the page)

    Simply create a text file in notepad with the following text and save as .aspx to you document library:

    <iframe src="http://<your LS site>/HTMLClient/default.htm" style="width:100%;height:100%;border:none;"></iframe>

    This is not unlike simply sending users to an external link so not a solution to display LS 'within' a SP web part page I'm afraid.

    Josh

    Sunday, October 27, 2013 2:28 PM

All replies

  • HI Martin

    I don't have a try use Page Viewer web part to show Lightswitch application.

    If you want to host lightswitch application in sharepoint. By using LightSwitch, you can create SharePoint apps that are hosted in the SharePoint Store or in your organization's private app catalog. By enabling SharePoint debugging, you can also host your app on SharePoint to test it during development.

    Here are some related reference for your information:

    How to: Host a LightSwitch HTML Client Application on Sharepoint

    http://msdn.microsoft.com/en-us/library/vstudio/jj863130.aspx

    hope it helps,

    Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 24, 2013 7:53 AM
  • Hi Angie,

    Thank you for taking the time to answer my question. Can you confirm that the provided article is about hosting LightSwitch HTML apps on SharePoint 2013 only?

    Regards,

    Martin

    Thursday, October 24, 2013 8:23 AM
  • Hello Martin,

    I too am looking to host a LightSwith solution in SharePoint 2010 on Premise at this time... I suspect that Angie's response in SharePoint 2013 only, as the article talks about SharePoint Apps which of course are SP 2013 features...

    The client is a few quarters away from a SP2013 infrastructure, yet I want to kick a SP on Prem hosted LightSwitch App out today.  I could stand up a Test / Dev / Acceptance Environment up for SharePoint 2013, but don't really want to go to that trouble right at the moment.

    Looking for options... 

    Cheers,

    Scott


    I suppot PASS - www.SQLPASS.org

    Thursday, October 24, 2013 11:15 PM
  • Firstly,  because of the oAuth in 2013 apps, you need to 'enable sharepoint' in your LS app and then it won't work on SP2010.  So you'll likely have to deploy the same app once with SP enabled for 2013 and again without sp enabled for 2010.

    But say you have a LS HTML app in which sharepoint is not enabled, you can display the app in an iFrame.  I tried this with Page Viewer and Content Editor on a web part page and, like you found, it doesn't work.  The errors in F12 are all in the .js of LS app as if the iframe is an earlier version of IE. 

    I was able to get it to work in a page saved to a document library on 2010 (not a web part page, so it doesn't have all the sp stuff on the page)

    Simply create a text file in notepad with the following text and save as .aspx to you document library:

    <iframe src="http://<your LS site>/HTMLClient/default.htm" style="width:100%;height:100%;border:none;"></iframe>

    This is not unlike simply sending users to an external link so not a solution to display LS 'within' a SP web part page I'm afraid.

    Josh

    Sunday, October 27, 2013 2:28 PM
  • Thank you Josh,

    This is a great solution. I also tried to add a custom SharePoint chrome control as explained here so the user would be able to get back to the SharePoint site as explained in this article http://blogs.msdn.com/b/lightswitch/archive/2013/05/14/customizing-the-sharepoint-chrome-control-in-lightswitch.aspx but that didn't work. I guess that internally it checks for enabled SharePoint site.

    @Scott - hope this works for you too

    Thanks again!
    Martin


    Monday, October 28, 2013 4:49 AM
  • Hi Martin,

    You're correct, the sharepoint chrome won't be added unless sharepoint is enabled.  But you can add it yourself in the iframe.aspx file like so:

    <div class="msls-sharepoint-chrome msls-vauto">
    <a class="msls-sharepoint-chrome-link ui-link" href="<your sharepoint site>/" target="_top">Back to site</a>
    <div>
    <iframe src="<your LS app>/HTMLClient/default.htm" style="width:100%;height:100%;border:none;"></iframe>

    This way it's not 'inside' the LS app so the styles don't apply, but you could dress up the div and a tags above. Alternatively, you could add them to the top of your LS Main screen, but I did not try that.

    HTH,

    Josh

    • Proposed as answer by joshbooker Wednesday, October 30, 2013 6:42 PM
    Monday, October 28, 2013 1:51 PM
  • Thanks Josh,

    You are my hero!

    Martin

    Wednesday, October 30, 2013 6:41 PM
  • After standing up a virtual sandbox environment with 3 VMs: 1) Windows server 2012 Active Directory Domain controller;   2) SharePoint 2013 server with SQL Server 2012;   3)Developer Box with Win8.1 and Visual Studio 2013.  

    I was able to deploy a "hello world" app... Now I learn that my client's SharePoint refresh may simply be a new SharePoint 2010 environment... FAIL!

    Sooooo, THANK YOU Josh!  This might come in handy... I will wait and see what motivates them to stay at SharePoint 2010 before I fire up LightSwitch again... 

    Thanks for sharing with the community!

    Cheers,

    Scott


    I suppot PASS - www.SQLPASS.org

    Thursday, November 07, 2013 6:54 AM