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.
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!!!
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.
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...
<object clsid="xxxxxxxxxxx" name="objMyActiveX">
<param name="Name" value="Sample">
<input type="button" value="Display Name" onclick="GetName">
Hope this helps!
oh ic, so in anycase or by anyway i can't use it in code behind right?
Anyway, Thanks for make me understand.
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).
Thanks a lot for all your suggestions.