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

  • Home
  • SEARCH
  • 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 554169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:40:53+00:00 2026-05-13T11:40:53+00:00

I have the following Silverlight control defined: <object id=objImageViewer data=data:application/x-silverlight-2, type=application/x-silverlight-2 width=100% height=500px> <param

  • 0

I have the following Silverlight control defined:

<object id="objImageViewer" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="500px">
    <param name="source" value="../ClientBin/SomeImageViewer.xap"/>
    <param name="onError" value="onSilverlightError" />
    <param name="background" value="white" />
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="autoUpgrade" value="true" />
    <param name="windowless" value="true" />
    <param name="initParams"
        value="
            Username=<%= ImageViewerUsername %>,
            Editable=<%= ImageViewerEditable ? "1" : "0" %>,
            Align=<%= ImageViewerAlign ? "1" : "0" %>
            " />
    <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 have exposed the following method in my Silverlight control (Page.xaml.cs) to be accessible to Javascript:

[ScriptableMember]
public bool HasPendingUpdates()
{
    return btnSave.IsEnabled;
}

I then have a Javascript test function in my aspx page that is trying to do something with it:

var imageViewer = $("#objImageViewer")[0];
if (imageViewer.Content.Page.HasPendingUpdates())
{
    alert("Pending Changes Exist!");
}
else
{
    alert("NO Pending Changes Exist!");
}

Problem is that it fails after the Content object. I have tested the following:

var imageViewer = $("#objImageViewer")[0];

imageViewer // Valid
imageViewer.Content // Valid
imageViewer.Content.Page  // Invalid
imageViewer.Content.HasPendingUpdates()  // Invalid

So I am not sure what I am doing wrong. How do I get to the function within Content?

I am using IE8, Silverlight 3, ASP.NET. The silverlight control is created with the object tag as I don’t think the control is an option in Silverlight 3+.

Any help would be much appreciated.

  • 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-13T11:40:54+00:00Added an answer on May 13, 2026 at 11:40 am

    You need to register with Silverlight HTMLBridge an identifier to expose on the Content property and give it an object that has some scriptable entry points.

    I tend to do this in the Page constructor:-

    public Page()
    {
         InitializeComponent();
         HtmlPage.RegisterScriptableObject("Page", this);
    }
    

    Now your code should work.

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

Sidebar

Ask A Question

Stats

  • Questions 446k
  • Answers 446k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In myapp.rb, add this before sinatra starts: puts "This is… May 15, 2026 at 7:13 pm
  • Editorial Team
    Editorial Team added an answer An UPDATE trigger already has the records affected by an… May 15, 2026 at 7:13 pm
  • Editorial Team
    Editorial Team added an answer is Guice really that ubiquitous? Is it really a must-know-must-use… May 15, 2026 at 7:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.