This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Custom Map Control
Last Post 15 Feb 2013 10:02 AM by cct. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
dejavuUser is Offline
New Member
New Member
Send Private Message
Posts:7
Avatar

--
10 Aug 2011 09:33 PM
    Hi everyone. First of all, this is my first post. I'll describe my development config:

    Visual Studio 2010 SP1
    Lightswitch 2011
    SQL Server 2008 R2 SP1
    Silverlight 4 + SDK

    I'm trying to implement a custom Silverlight 4 control, following examples on this (great) web site and others found on the Internet. First, i wanted to use the Bing Maps control, but Bing Maps cannot search for addresses where I live (Chile). So i decided take the following path:

    1.- Build a simple but excepcion aware ASP.NET web site, to display a map control using Google Maps services, and their JavaScript API v3. Address will be provided in query string (so "excepcion aware" is a must in this little app.

    2.- In the same Visual Studio solution, created a new Silverlight 4 user control, wrapping a WebBrowser control, and their Source property binding to Screen.ENTITY_NAME.Address

    3.- Add in Lightswitch app code, the URL to the web site implementing google map control, and giving it as a query string parameter, the Address field in my entity Screen. So, address field for this entity will be a full URL pointing to a web app containing a google map control.

    Everything works ok, but, for some reason and in a very random way, my Lightswitch app crashes. The error message (registered in event log) is pointing at SLLauncher.exe

    So, i wanted to know if it is possible toi catch apps exceptions in a global way in Lightswitch, as a first measure. Secondly, try to make the same but at the silverlight control level.

    Because of this being a random crash, don't know what else to do.

    Thanks in advance ppl.
    "My pain is constant and sharp. And I do not hope for a better world for anyone. In fact, I want my pain to be inflicted on others"

    -- American Psycho
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1313
    Avatar

    --
    10 Aug 2011 09:45 PM
    This may help:
    Tracing: Debugging Your LightSwitch Application In Production

    http://lightswitchhelpwebsite.com/B...ction.aspx

    but, you may have found a bug so you want to post to:

    http://social.msdn.microsoft.com/Fo...ch/threads
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    dejavuUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:7
    Avatar

    --
    10 Aug 2011 09:51 PM
    Wow...that was fast. Thanks for your really quick answer. Promise to upload a demo app about this custom control when i get this working.

    Will check this and let you know about.
    "My pain is constant and sharp. And I do not hope for a better world for anyone. In fact, I want my pain to be inflicted on others"

    -- American Psycho
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1313
    Avatar

    --
    10 Aug 2011 09:53 PM
    Promise to upload a demo app about this custom control when i get this working.

    That sounds great
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    dejavuUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:7
    Avatar

    --
    10 Aug 2011 10:28 PM
    UPDATE: read the article, but this app is Desktop based (a lot of file IO operations, and a couple of local coporate network resources usage determines this), so tracing as I see is not an option, sadly. On the other hand, I could implement this app as a Web based one, just to analize it's trace. But in that case my custom Silverlight control is useless, because it is based on a WebBrowser SL control.

    Any other idea?. I'll check logs in the system relative to SLLauncher.exe, because everything points to this exe.

    Regards.
    "My pain is constant and sharp. And I do not hope for a better world for anyone. In fact, I want my pain to be inflicted on others"

    -- American Psycho
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1313
    Avatar

    --
    10 Aug 2011 11:03 PM
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    dejavuUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:7
    Avatar

    --
    22 Feb 2012 10:58 PM
    Well...after a few months from my first attempts finally I decided to throw it away for a while. Anyway, as a lot of people here and there told me, the problem using a WebBrowser pointing at a web app that is a full web page gmaps control, is the amount of javascript that needs to be handled.

    Another aspect is that everytime I tried to use this approach, WebBrowser controls spit out a javascript parse error. I guess because of XSS restrictions of WebBrowser control, that's based on Internet Explorer engine.

    So, IE security policies get applied. Nothing to do with that. The only way as I see right now is to develop a custom totally from scratch WebBrowser control. That way, if original WebBrowser control has methods to override scripting security policies, perhaps it's possible to lower that policies, and finally get a WebBrowser control-like more permissive to scripting from others domains.

    All this sounds like it works for me. But just in a couple of times I've done custom controls, and it was in the old ASP.NET 1.1 ages.

    Cheers,
    dejavu
    "My pain is constant and sharp. And I do not hope for a better world for anyone. In fact, I want my pain to be inflicted on others"

    -- American Psycho
    cctUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:2
    Avatar

    --
    15 Feb 2013 10:02 AM
    Posted By dejavu on 23 Feb 2012 06:58 AM
    Well...after a few months from my first attempts finally I decided to throw it away for a while. Anyway, as a lot of people here and there told me, the problem using a WebBrowser pointing at a web app that is a full web page gmaps control, is the amount of javascript that needs to be handled.

    Another aspect is that everytime I tried to use this approach, WebBrowser controls spit out a javascript parse error. I guess because of XSS restrictions of WebBrowser control, that's based on Internet Explorer engine.

    So, IE security policies get applied. Nothing to do with that. The only way as I see right now is to develop a custom totally from scratch WebBrowser control. That way, if original WebBrowser control has methods to override scripting security policies, perhaps it's possible to lower that policies, and finally get a WebBrowser control-like more permissive to scripting from others domains.

    All this sounds like it works for me. But just in a couple of times I've done custom controls, and it was in the old ASP.NET 1.1 ages.

    Cheers,
    dejavu
    Thx a lot.

    I love video games and online games,the site is http://www.diabloiiigold.com
    You are not authorized to post a reply.


    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation