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 7627463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:27:46+00:00 2026-05-31T05:27:46+00:00

I have the following (2) ‘ScriptableMember’ types in my Silverlight control: <ScriptableMember()> Public Property

  • 0

I have the following (2) ‘ScriptableMember’ types in my Silverlight control:

<ScriptableMember()>
Public Property MType As MyCustomType

<ScriptableMember()>
Public Property Message As String

The purpose here is obviously to allow exposure via the HTML bridge in Javascript. Calling the ‘Message’ property is trivial and works perfectly like below:

var SLControl = document.getElementById("SilverlightControl");
SLControl.Content.MyRegisteredControl.Message = 'Hello';

However I am having trouble setting the values of an instance property by drilling down to its properties in JS. The code I would think should be as below:

SLControl.Content.MyRegisteredControl.MType.Name = 'John';

Notice how I added in the ‘MType’ and then accessed one of its Public Properties named ‘Name’. The MyCustomType class has all the appropriate ‘ScriptableMember’ atributes as required.

However when that line above is ran I get the following error:

“Microsoft JScript runtime error: Object doesn’t support this property or method”

It works just fine on the assignment of ‘Message’. Is it possible in JS to drill down through an instance property and assign its variables? If so do I have the JS incorrect, or what do I need to do to fix this. Thanks!

  • 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-31T05:27:47+00:00Added an answer on May 31, 2026 at 5:27 am

    Well I didn’t get any help on this one but I figured it out and the answer is ‘yes’.

    1st I have an instance property on my Silverlight control that looks like the following:

    <ScriptableMember()>
    Private _MyClass1 As New MyCustomClass
    Public Property MyClass1() As MyCustomClass
     Get
       Return _MyClass1
     End Get
     Set(ByVal value As MyCustomClass)
       _MyClass1= value
     End Set
    End Property
    

    As required by the HTML bridge, register an instance of my control’s class instance so I can gain access from JavaScript:

    HtmlPage.RegisterScriptableObject("MySLControl", Me)
    

    Now I thought I needed to register another member above for the instance property, but I did not not need to do that. You can drill down to it through the main class instance exposed as a scriptable member as shown below:

    //Get instance of the Silverlight File Upload Control
    var SLControl = document.getElementById("SilverlightControl");
    if (SLControl != null)
      //Drill down through the instance property exposed on the Silverlight control
      SLControl.Content.MySLControl.MyClass1.Name = "John Smith";
    

    The thing that threw me off was thinking I needed to register an instance of a scriptable type for the instance property, but I did not need to do that. I could just drill down and access the property.

    The following post expands on this a bit more:
    Accessing Instance Properties in Silverlight from JavaScript

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

Sidebar

Related Questions

Have following code: public interface ITest { string St1 { get; } } public
I have following code: public class reader extends Activity { WebView mWebView; String mFilename;
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following classes. class A { public: void fun(); } class B: public
I have following method in wcf webenabled service Public Person AddPerson(Person p); As of
I have following piece of code: public void ProcessRequest (HttpContext context) { context.Response.ContentType =
I have following string adId:4028cb901dd9720a011e1160afbc01a3;siteId:8a8ee4f720e6beb70120e6d8e08b0002;userId:5082a05c-015e-4266-9874-5dc6262da3e0 I need only the value of adId,siteId and userId.

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.