I have created a reference to a 3rd party activex control. I have
added it to my components tab. I can successfully drag and drop the
control onto the web form and have it display properly on the
browser....my issue comes in when I try to actually reference that
object from the code-behind page.
For testing, I have created a button so that when the button is
clicked a new item is added to the one of the collections of the
object.
When I try to do this from the code-behind with the "button.click"
event handler, it says that the name of the instance of the object is
not declared.
When I try to handle this on the client side, it totally seems to
bypass my script.
.aspx code*******
<%@ Import namespace = "scheduler" %>
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="PBISched.aspx.vb" Inherits="PatientApp.PBISched"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>PBISched</title>
<META content="Microsoft Visual Studio.NET 7.0"
name="GENERATOR">
<META content="Visual Basic 7.0" name="CODE_LANGUAGE">
<META content="JavaScript"
name="vs_defaultClientScript">
<META
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<SCRIPT language="javascript"
id="clientEventHandlersJS">
<!--
function pbi_ondataavailable() {
}
//-->
</SCRIPT>
<SCRIPT language="javascript" event="ondataavailable"
for="pbi">
<!--
return pbi_ondataavailable()
//-->
</SCRIPT>
<SCRIPT language="vb" for="pbi" >
'********** next line is the one that I am hoping to get working******
Call pbi.rooms.Add("Room1")
</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout">
<FORM id="Form1" method="post" runat="server">
<INPUT type="submit" value="Submit">
<asp:Button id="Button1" runat="server"
Text="Button"></asp:Button>
<OBJECT id="pbi" style="Z-INDEX: 101; LEFT:
95px; WIDTH: 521px; POSITION: absolute; TOP: 59px; HEIGHT: 175px"
classid="clsid:CB93D4CA-F746-11D2-9118-00A0241E587F" name="pbi">
</OBJECT>
</FORM>
</BODY>
</HTML>
*******code behind
Public Class PBISched
Inherits System.Web.UI.Page
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
'************** HERE it doesnt recognize pbi *****************
Call pbi.rooms.Add("Room1")
End Sub
End Class