Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: OCX control in an ASP.NET (VB.NET) Web Form


Message #1 by "James Barauskas" <tek4urpc@a...> on Thu, 30 Jan 2003 11:55:33
Hello.

What am I doing wrong? I made a simple activex control which is a label 
and a timer. There are two methods in the control tGO and tSTOP. when tgo 
is called the timer interval is set and is enabled. The label caption 
begins displaying the time like a digital clock. tSTOP disables the timer.
I made a VB standard exe project and brought the ocx in as a component, 
put it on a form and it ran wonderful. Now I want to use the ocx on a web 
page from an asp.net web forms project. I read on MS site that I can 
either make a Ref to the control and instantiate from code, or add to tool 
box as a component. I chose the latter. I dragged the control onto a 
webform object and ran the page - the control showed up ok. I went back to 
code module for webform to write the code to call go and stop - But here's 
the problem: The Public Methods I wrote in the ocx are not available in 
the webform code module. It's like the project "sees" the visual aspect of 
the control but it has no Object aspect of it. I looked in Object Browser 
and I see me control namespace there and I can branch out and see the 
methods but I can't call them from anywhere in the project code. I read on 
MS site that in order to use an OCX in a WIN FORMS project you have to run 
AXIMP.EXE compiler on each one to make a net wrapper for it, but it say's 
nothing about having to do this for WEB FORM projects. Please Help.

Any help is greatly appreciated. I need to make a client side "Applet" but 
I don't currently program in Java, so AX is what I am going to use.

Thanks
James

  Return to Index