By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

ActiveX control on ASP.NET Web Form Runtime Error

P: n/a
ann
Hi,

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:

<HTML>
<HEAD>
<title>WebForm1</title>
<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
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>

<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:
208px"
codeBase=PrntPRO2.cab classid=clsid:9841D1AE-9C0B-11D3-
9452-00105A098C21
name=objPrint VIEWASTEXT>
<PARAM NAME="_cx" VALUE="953">
<PARAM NAME="_cy" VALUE="794">
<PARAM NAME="AddCR" VALUE="-1">
<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">
<PARAM NAME="OwnDIB" VALUE="0">
</OBJECT>
<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.
objPrint.PrintDialog
End Sub

-->
</script>
</form>

</body>
</HTML>
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!

Ann

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.