'Class Lib
Namespace ActiveXDotNet
Public Interface AxMyControl
Property UserText() As String
End Interface 'AxMyControl
End Namespace
Public Class UserControl1
Private mStr_UserText As [String]
Public Property UserText() As String
Get
Return mStr_UserText
End Get
Set(ByVal Value As String)
mStr_UserText = Value
'Update the text box control value also.
txtUserText.Text = Value
End Set
End Property
End Class 'myControl
'WEb App COde
<html>
<head>
<title>
</title>
</head>
<body >
<hr/>
<font face="arial" size="1">
<object id="myControl1" name="myControl1" classid="ClassLibrary2.dll#ActiveXDotNet.UserControl1"
width="288" height="72">
</object>
</font>
<form name="frm" id="frm">
<input type="text" name="txt" value="enter text here"/><input type="button" value="Click me" onclick="doscript();"/>
</form>
<hr/>
</body>
<script type="text/javascript">
function doscript() {
UserControl1.UserText = frm.txt.value;
}
</script>
</html>
|