469,951 Members | 2,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

ActiveX control on ASP.NET Web Form Runtime Error


I am trying to add an ActiveX control on my ASP.NET web
form (the language for code behind is C#). I have some
client-side vbscript to handle events from the html input
buttons. In the client-side script, I am calling the
ActiveX control object to perform some job. The problem
is: when I run the application and click on the button
(which fires the event), I get a runtime error: Microsoft
VBScript runtime error: Object required: 'xx', where
the 'xx' is the ActiveX object name.

Following is a sample html from my app:

<meta name="GENERATOR" Content="Microsoft Visual
Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="VBScript">
<meta name=vs_targetSchema

<body MS_POSITIONING="GridLayout">
<form name="Form1" method="post"
action="WebForm1.aspx" id="Form1">

<OBJECT id=objPrint
style="Z-INDEX: 107; LEFT: 406px; POSITION: absolute; TOP:
codeBase=PrntPRO2.cab classid=clsid:9841D1AE-9C0B-11D3-
name=objPrint VIEWASTEXT>
<PARAM NAME="_cx" VALUE="953">
<PARAM NAME="_cy" VALUE="794">
<PARAM NAME="Alignment" VALUE="0">
<PARAM NAME="BackColor" VALUE="16777215">
<PARAM NAME="BackStyle" VALUE="0">
<PARAM NAME="BMargin" VALUE="360">
<PARAM NAME="CurrentX" VALUE="360">
<PARAM NAME="CurrentY" VALUE="360">
<PARAM NAME="DrawMode" VALUE="13">
<PARAM NAME="DrawStyle" VALUE="1">
<PARAM NAME="DrawWidth" VALUE="1">
<PARAM NAME="FillColor" VALUE="0">
<PARAM NAME="FillStyle" VALUE="1">
<PARAM NAME="ForeColor" VALUE="0">
<PARAM NAME="LMargin" VALUE="360">
<PARAM NAME="ScaleMode" VALUE="1">
<PARAM NAME="TMargin" VALUE="360">
<PARAM NAME="WordWrap" VALUE="-1">
<PARAM NAME="Font" VALUE="MS Sans Serif">
<PARAM NAME="AutoMargin" VALUE="-1">
<PARAM NAME="OutputFileName" VALUE="">
<PARAM NAME="PicTransparent" VALUE="0">
<PARAM NAME="PicTransparentColor" VALUE="0">
<PARAM NAME="UseDefaultPrinter" VALUE="-1">
<PARAM NAME="PrintPreviewScale" VALUE="2">
<PARAM NAME="PrintPreviewOnly" VALUE="0">
<INPUT id="btnPrint" style="Z-INDEX: 108; LEFT:
469px; WIDTH: 92px; POSITION: absolute; TOP: 34px; HEIGHT:
24px" type="button" value="Print Image" name=btnPrint>

<script id="clientEventHandlersVBS" language="vbscript">
Sub btnPrint_onclick
'Print a banner at the top of the page, white on black.
End Sub


The program is stopped on the line: objPrint.PrintDialog,
and I keep on getting the objPrint required runtime error.

This ActiveX control and code works fine under a normal
html page. Just not working when I port that to ASP.NET
web form.

Is there anything I need to do in Visual Studio.NET, or in
the ASP.NET web app project setting? Or is it that I need
to have some code somewhere to make ASP.NET realize
there's this ActiveX object?

Thanks in advance for the help!


Nov 17 '05 #1
0 4255

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Shawn | last post: by
3 posts views Thread by Evan Delodder | last post: by
reply views Thread by roni | last post: by
4 posts views Thread by Wilfried Mestdagh | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.