Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 596859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:13:03+00:00 2026-05-13T16:13:03+00:00

I’ve used an object tag to load my Silverlight control because I want to

  • 0

I’ve used an object tag to load my Silverlight control because I want to be able to input html into a Sharepoint page using the Rich Text Editor. It looks like this:

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="SilverlightObject"
    width="850" height="600">
      <param name="source" value="ClientBin/LabsSurvey.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="minRuntimeVersion" value="3.0.40624.0" />
      <param name="autoUpgrade" value="true" />
      <img src="ClientBin/InstallSilverlightLabsBanner.jpg" alt="Please Install Silverlight" />
      <br />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>

    </object>

I’ve use the Javascript bridge in other Silverlight apps, and it works great for two-way communication between the web page and the Silverlight control.

BUT – it seems that in order for this to work, I have to instanciate my Silverlight control using the .NET Silverlight control.

I can not get a javascript call to a method within my Silverlight control to work when I’ve used the object tag. I set it up exactly the same way as in my other apps where it does work – the only difference is that the control was not embedded the same way in the html.

Does anyone have any tips for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:13:04+00:00Added an answer on May 13, 2026 at 4:13 pm

    It’s also key to include the windowless parameter in your object definition in addition to the information called out in the answer from Kelsey. Without windowless=true, the call to Content will always return undefined….

    Sample object definition:

        <div id="silverlightControlHost">
        <object id="silverlightObject" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/LabsCharts.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="windowless" value="true" />
          <param name="minRuntimeVersion" value="3.0.40624.0" />
          <param name="autoUpgrade" value="true" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
    

    VB.Net class to register scriptable object:

    Imports System.Windows.Browser
    

    _
    Partial Public Class MainPage
    Inherits UserControl

    Public Sub New()
        ' Required to initialize variables
        InitializeComponent()
        AddHandler Loaded, AddressOf MainPage_Loaded
    End Sub
    
    Protected Sub MainPage_Loaded(ByVal sender As Object, ByVal e As EventArgs)
        HtmlPage.RegisterScriptableObject("MainPage", Me) 'not working!
    
        Dim so As ScriptObject = TryCast(HtmlPage.Window.Eval("charts"), ScriptObject)
        so.Invoke("registerSilverlight")
    End Sub
    

    Public Sub SayHi()
    MessageBox.Show(“HI!!!!!”)
    End Sub

    End Class

    And the javascript function, registerSilverlight

    var charts = {
    registerSilverlight: function() {
    
        var func = document.getElementById('silverlightObject');
        var content1 = func.Content;
        content1.MainPage.SayHi();
    
    
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
i got an object with contents of html markup in it, for example: string
I used javascript for loading a picture on my website depending on which small
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.