Embedded dll in html page

A

Andrew

Hi,

I've tried creating a very basic class library. It has one object and one
property. The property returns always the same string value. I then use the
<OBJECT> tag to embed the dll in my page. The dll and html sit in a root
directory on my IIS 6 server. Code is below:

namespace ClassLibrary1
{
public class myObject
{
public myObject()
{
}

public String AValue
{
get
{
return "hello";
}
}
}
}

The html code is as follows:

<html>
<body color=white>
<hr>
<OBJECT id="myControl1" name="myControl1"
classid="ClassLibrary1.dll#ClassLibrary1.myObject">
</OBJECT>
<INPUT id=TxtBox>
<script language="vbscript">
TxtBox.value = myControl1.AValue
</script>

<hr>
</body>
</html>

The html page returns the error "Object doesn’t support this property or
method".

I hope you can help - I must be missing something but I'm surely stuck!


Andrew
 
R

recoil

Object does not support this property opr method usually means that the
object very well could be null. Is the Custom Control actually showing
up on the web page.

If the object is a non-visual object then you should do the following.

Do yourself a favor and before the TxtBox.value = myControl put a
if myControl1 is null then msgbox "object is null and dll is not loaded"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,888
Messages
2,569,967
Members
46,297
Latest member
johnsariin

Latest Threads

Top