Results 1 to 6 of 6

Thread: How to insert two Silverlight applications within an HTML page

  1. #1
    Join Date
    Jan 2010
    Posts
    99

    How to insert two Silverlight applications within an HTML page

    I have recently started doing the coding in Silverlight application. So frankly speaking, I am not having great ideas about it. Now I am having the problem while inserting the two different Silverlight applications in a HTML page. I have tried to do lot of things but was not succeeded. So lastly I gave up and thought to take some help from you guys. I have also tried to search this problem on Internet but didn't find any appropriate solutions. So please tell me how to insert two Silverlight applications within an HTML page? I am expecting some quick response from your side.

  2. #2
    Join Date
    Mar 2008
    Posts
    433

    Re: How to insert two Silverlight applications within an HTML page

    A Silverlight application is embedded in an HTML page using a tag <OBJECT>. This tag allows <OBJECT> reference the Silverlight plug-in in your page by specifying a few parameters such as the source of the XAML file, the background color, the display mode and so on.

  3. #3
    Join Date
    Feb 2008
    Posts
    137

    Re: How to insert two Silverlight applications within an HTML page

    Theoretically, it suffices to duplicate the tag <OBJECT> to create a second Silverlight application to your page, as follows:
    HTML Code:
    <html> 
      <body> 
      <Object width = "400" height = "300" id = "SilverlightControl1" 
      type = "application / silverlight-x"> 
       <param name= "source" value = "Page.xaml" /> 
      </ Object> 
      <Object width = "400" height = "300" id = "SilverlightControl2" 
      type = "application / x-silverlight"> 
       <param name= "source" value = "Page.xaml" /> 
      </ Object> 
      </ Body> 
      </ Html>
    However, this approach to include your Silverlight application in your HTML page is abstinence from the "Fallback" (silverlight.js), that is to say, among other things, the entire management of versioning plugin Silverlight sense software term. Something that is not recommended.

  4. #4
    Join Date
    Feb 2008
    Posts
    129

    Re: How to insert two Silverlight applications within an HTML page

    In practice it will therefore have to integrate so cleanly Silverlight <OBJECT> two tags in your page with the fallback management and event management for each application. As well as the fact the software Expression Blend for one movie I'll propose a solution using the files Silverlight.JS & CreateSilverlight.JS redesigned.

  5. #5
    Join Date
    Oct 2008
    Posts
    180

    Re: How to insert two Silverlight applications within an HTML page

    Introducing the new function call createSilverlight within the HTML page:
    HTML Code:
    <Html> <body> 
      ... <Div id = "SLSponsor" class = "sponsor"> 
       <Script type = "text / javascript"> 
        createSilverlight ('Sponsor.xaml' new Sponsor.Page (), 'SLSponsor'); 
       </ Script> 
      </ Div> ... 
      </ Body> </ html>
    I am sure that this coding will help you definitely.

  6. #6
    Join Date
    Feb 2008
    Posts
    180

    Re: How to insert two Silverlight applications within an HTML page

    Here is the new file and function CreateSilverlight.JS "createSilverlight" remodeled :
    HTML Code:
    createSilverlight function (xaml_page, sl_scene, parent_element) 
      ( 
       Silverlight.createObjectEx (( 
        Source: xaml_page, 
        parentElement: document.getElementById (parent_element) 
        id: "SLControl_" + parent_element, 
        properties: ( 
         width: "100%" 
         height: "100%" 
         version: "1.0" 
        ) 
        events: ( 
         onLoad: Silverlight.createDelegate (sl_scene, sl_scene.handleLoad) 
        ) 
       )); 
      )
    Unlike ASP.NET Futures XAML and control, I want to say that no solution is dependent on the hosting server and is compatible with applications such as PHP, Java,. NET.

Similar Threads

  1. What is the approach component HTML in Silverlight?
    By Fragant in forum Windows Software
    Replies: 5
    Last Post: 06-08-2010, 11:19 PM
  2. Can I do the HTML Hosting in Silverlight 4?
    By Feng in forum Windows Software
    Replies: 4
    Last Post: 05-08-2010, 06:24 AM
  3. How To Insert a HTML Page Inside The Flex
    By sweetsriheart in forum Software Development
    Replies: 2
    Last Post: 27-06-2010, 04:20 PM
  4. How to insert Flash movie in HTML web page
    By Lishi in forum Software Development
    Replies: 3
    Last Post: 02-10-2009, 11:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,588,170.37892 seconds with 17 queries