How can I create an ActiveX in a C # control and reference it in an ASP.NET site?

How do I create an activeX control in a C # library project and then reference it in another ASP.NET website project?

+1


source to share


3 answers


This article seems to describe what you are asking for.



0


source


If you use C # /. NET to build your control and consume it from ASP.NET, you will get better performance (and much less pain for yourself) by referring to it as a standard .NET assembly, bypassing ActiveX entirely. Hope this helps!



Adam

+1


source


Is ActiveX client-side or server-side?

If for the server just use a direct reference to the managed assembly (no need for COM).

Trust the client, I'm honestly not sure it's a good idea to write ActiveX controls - most browsers won't like them. You're better off with AJAX and DHTML, or Silverlight / Acrobat / etc for something more complex.

[update] So you want an ActiveX on the client ... my next one is at least "can Silverlight access the certificate store?" I can't find anything though ...

Distributing an ActiveX control (for IE) usually involves packaging the DLL into a booth, making it safe for scripting and safe for activation. Then you place the cockpit on the web server, and on the ledge, you have an element <object...>...</object>

defining the source code (code) of the cockpit.

I must emphasize that this approach will be very hit and miss; it won't work in many browsers and will work for a while in IE (depending on the user's security settings). I do not recommend it.

A more practical option would be to write a stand-alone .NET exe that you package through ClickOnce ("Publish" in VS); release ClickOnce deployment on website and navigate to application. Voila - complete .NET code on client, no browser issues.

+1


source







All Articles