Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object doesn't support this property or method

Status
Not open for further replies.

NaiDanac

Programmer
Mar 25, 2004
96
US
I'm experiencing some strange behaviour with HTML embedded controls.

I use the following code:

Code:
<object id=myControl classid=[URL unfurl="true"]http://server/share/MyControl.dll#MyControl.usercontrol></object>[/URL]
<input type='button' name='go' onclick='RunControl()' Value='Submit'>

<script language="JavaScript">
function RunControl()
{
	myControl.value = 10;
	alert(myControl.value);
	myControl.go();
}
</script>


The control has one property (value) and one method (go).

On my development machine: when I run the page, the control is downloaded correctly. When the button is clicked, the RunControl function is executed. I am able to set the property to the value 10, and read it back (using the alert(myControl.value)). I am also able to execute the .go() method (which by the way does a msgbox("Hello World"), which is displayed on the screen).

This is not the result that I get when testing on another XME machine!

My development machine (XME) has VS.NET 2003 on it. When I run the page from a regular XME machine (i.e. no VS.NET03) I get an error when the execution reaches the myControl.go(); line. It says: "Object doesn't support this property or method". It is able to set value and read it back correctly though. The "Object doesn't support this property or method" error is only encountered when testing on the XME machine that does not have VS.NET03. I then installed VS.NET03 on that machine, and sure enough the problem went away, and I was able to execute the page correctly. I finally removed VS.NET03 from that machine, and the problem came back. It seems that VS.NET03 is installing something on the machine that is needed by the above code, but I'm unsure as to what it is!

Have you seen something like this before? Does it have to do something with JavaScript?

Nai
 
What language is MyControl.dll written in? If it's a .NET DLL (and it looks like it is), then it probably won't work on a computer that doesn't have the .NET framework installed. That's just a guess here, though.

The error message is telling you that your DLL doesn't have the method go(), or at least not accessible on the page. And that means that there's a problem with your DLL object, not Javascript.

Lee
 
It's programed in .NET (as you have guessed). The machine does have the .NET framework. I don't think there is a problem with the go() method, since it runs fine when VS.NET2003 is installed on that machine!

This is a strange one.

Nai
 
I wouldn't use .NET objects with all the non-XP computers out there.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top