Ask a Question related to ASP.NET General, Design and Development.
-
ann #1
ActiveX control on ASP.NET Web Form Runtime Error
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
ann Guest
-
User Control and ActiveX control
Now I am hosting a user control(an assembly in .dll) in IE. I want to know the difference between this kind of control and ActiveX control. thank... -
Adding Validator Control at runtime in a Custom Control
Hi Wim, How do we link the TextBox to this validator control class in runtime ? Could you please tell. Thanks _ Muds. Wim Hollebrandse... -
VB runtime errors "ActiveX can't create object"
How is the VB component compiled? Using 'unattended execution'? -- compatible web farm Session replacement for Asp and Asp.Net... -
Error Setting user control property at web form
Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I... -
PLS HELP: ActiveX control / apartment threading error
Hi, If you want to use the activex controls in your asp.net page, you ahev to use the single aprtment thread model. For that please add the...



Reply With Quote

