How to use ActiveX control made in VB6.0

NimX
01-05-2004, 02:05 AM
hi guys,

Can i use my ocx control Made in VB6.0 in Webforms in ASP.net
if yes, How can i do that.. i did the followings.

I have added component reference from menu Tools >> Customize Toolbox...

I can see control on General TAB of Toolbox but when i drag it to the webforms i don't get its real name, instead i Get it as a <object>.

What should i do?
Note: the same ocx is working fine in Windows Forms of .net.

Please help me out.

Regards,

gundavarapu
01-06-2004, 02:14 AM
If you want to use it like any other control... you cannot use a activex control in web form... You can anyhow include the activex control onto the form using <object> tag in html.

This is because, the activex control is not programmed to be rendered onto the browser like any other web form control.

Hope this helps!!!

NimX
01-06-2004, 03:47 AM
yes, i'm getting <Object> tag instead of my controls' name tag.
but i wanna know how can i use its events and methods.
can i use that control in code behind. i'm not getting its reference in code behine page.

gundavarapu
01-07-2004, 01:42 AM
No, you cannot use the activex control in the code behind.
but, you can use it in the client side scripting. you can set the param values using scripting and call the objects methods using the object name within the client side script.

some thing like this can be used...

<Script>
sub GetName
alert(document.forms("Form1").objMyActiveX.Name)
end sub
</Script>
....

<object clsid="xxxxxxxxxxx" name="objMyActiveX">
<param name="Name" value="Sample">
</Object>

<input type="button" value="Display Name" onclick="GetName">
...


Hope this helps!

NimX
01-08-2004, 04:55 AM
oh ic, so in anycase or by anyway i can't use it in code behind right?
Anyway, Thanks for make me understand.

Optikal
01-08-2004, 07:03 AM
I would HIGHLY recommend against using an ActiveX control on a web page. It will not display on alot of client browsers, since most browsers disable unsigned ActiveX controls by default, and even signed ActiveX controls provide far too many hassles for the clients (IMHO).

NimX
01-11-2004, 08:52 PM
Thanks a lot for all your suggestions.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum