Codeless Posted February 13, 2003 Posted February 13, 2003 I have an ActiveX control that I have used in VB6 several times, but I can't seem to get it to work in .NET. What are the general steps to getting it to work in the .NET environment? I can add the component into my ToolBox and place it on my aspx, but then the code behind page doesn't seem to recognize it as a control. I have tried to run the TblImp.exe on the original dll, but after I do, I can't add it to the ToolBox successfully. Am I way off base? Quote Codeless ...it just goes on and on.
*Experts* Bucky Posted February 13, 2003 *Experts* Posted February 13, 2003 In addition to adding it your toolbox, you also need to add a reference to the control in your project's references. Go to the Project menu, then Add Reference. Select the COM tab, and look for the control on the list or click Browse to find the DLL. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Codeless Posted February 13, 2003 Author Posted February 13, 2003 Thanks, I had forgotten to do that. Another one of my problems was that I didn't know I could give the control a name in the (id) property to expose the events on the code behind page. Well now I know... and knowings half the battle. --GI Joe Quote Codeless ...it just goes on and on.
Codeless Posted February 18, 2003 Author Posted February 18, 2003 Didn't work after all I guess I spoke too soon. That actually wasn't the fix I was looking for. If I place the control on a Windows Form and run the app, it seems to work just fine as it did in VB6. However when I place it on a Web Form, I can't seem to interact with it. The control loads graphics (2D and 3D) Here are the clues: The control appears on the web form, and when I run the app without interacting with it I get no errors and I can see that the control is working fine, although empty. When placed on the web form it gets declared as a generic object instead of with the class that is normally used in the windows form even though I have a reference to the class library in the solution explorer. When I try and reference it from the code-behind with its (id) name to load something to it, it is not recognized and tells me that the name has not been declared. I can define a new control programmatically without errors, but can't add it to the web page because it is not a 'system.web.ui.control'. Any suggestions are greatly appreciated. I hope this all makes sense. Quote Codeless ...it just goes on and on.
*Gurus* Derek Stone Posted February 18, 2003 *Gurus* Posted February 18, 2003 For the same reason that you can't add web controls to a windows form you can't add windows controls to web forms. They exist on two entirely different mediums, and should remain as such. Simply put, you're going to have to separate the ActiveX control, which I wouldn't recommend using in the first place, from your .NET logic. Don't expect to be able to interact with it like you would any of the controls found under System.Web.UI, since the most control you're going to have over it is passing it parameters via Response.Write(). Quote Posting Guidelines
Codeless Posted February 18, 2003 Author Posted February 18, 2003 I was expecting to be able to interact with it because when I add it to my toolbox it always shows up in the web forms tab. I guess that's just because of the way it was created. Any other suggestions of how to expose it through the web would be very helpful. I do have a java applet that was sent with it. Can I expose the applet to people from the server side using .NET and jscript or something? (I legally can't distribute it in a client app). If so could someone point me in the right direction. Thanks. Quote Codeless ...it just goes on and on.
*Gurus* Derek Stone Posted February 19, 2003 *Gurus* Posted February 19, 2003 No, you cannot. Neither Java applets nor ActiveX controls (COM) are .NET components. The framework would have no idea how to render these objects. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.