Click here to Skip to main content
15,886,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to used the registered activeX control at server side in ASP or ASP.NET web page?
if we write the Global.asa file to access the object then ho to access this object in ASP page.
global.asa file
<object name="axGlobasys"  id='axGlobasys' runat ="server" scope="application"   classid='CLSID:0F01FC4F-CCBB-4bfd-8805-204D4ED49647' codebase='AxControlsGlobasys.cab#version=1,0,0,0'></object> 


how to access the activeX control through web server?

thanks in advance
Posted

1 solution

In ASP.Net, you would just set a reference to the COM object in your project

Adding the reference will create a COM Interop [^] assembly that you can then use from your .Net code

In classic ASP, you can use the Server.CreateObject [^] method and pass the prog ID of your COM component.

You would do this in your particular ASP page that needs to use the functionality, not in the Global.asa

--EDIT -- Follow these steps

1) Open your project in visual studio
2) On References, right click and choose 'Add Reference'. The dialog is displayed
3) Switch to COM tab, find you COM DLL and double click to add reference. The Interop DLL is added to your references
4) In your 'code behind', you can now use your COM. Add a using statement

using MyComLibrary;


5) Create and use your objects

C#
MyCOMClass item = new MyCOMClass();
item.DoSomething();
 
Share this answer
 
v2
Comments
vrushali katkade 8-Dec-11 5:15am    
can you describe the example & my activeX control in C#.NET
Dylan Morley 8-Dec-11 5:22am    
See update - cant say anymore than that. If still unsure, read up on C# COM Interop, lots of google results on the topic

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900