HELP!!!!! Im going nuts here trying to figure this out!!!
Im trying to write a usercontrol, which will allow you to set and get values from an internet explorer window using javascript. I have tried for months on and off trying to get this working, but cant. Please HELP!!!!!
The line 'myControl1.getUserText' just gives me 'Undefined'
Any ideas, please!!!!!
-------------------------------------------------------------------------------------------------------------
HTMLCode
-------------------------------------------------------------------------------------------------------------
<html>
<body color=white>
<hr>
<font face=arial size=1>
<OBJECT id="myControl1" name="myControl1" classid="userControlTest1.dll#ClassLibrary1.UserControl1">
</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 language="javascript">
function doScript()
{
alert(myControl1.getUserText);
}
</script>
</html>
-------------------------------------------------------------------------------------------------------------
VB.net Code
-------------------------------------------------------------------------------------------------------------
Public Class UserControl1
Inherits System.Windows.Forms.UserControl
Implements AxMyControl
Public Function getUserText() As String Implements AxMyControl.getUserText
Return "Banannas"
End Function
Public Sub setUserText(ByVal strUser As String) Implements AxMyControl.setUserText
TextBox1.Text = "Banannas"
End Sub
Public Interface AxMyControl
Sub setUserText(ByVal txtUser As String)
Function getUserText() As String
End Interface
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Now.Second
End Sub
End Class