Tuesday, November 18, 2008

How to redistribute ActiveX controls with Web Application

If your website using ActiveX control then it needs to be installed on the client machine to use the functionality your website is providing through this control. Generally when such functionality is browsed by the client, web browser prompts the user for the installation of ActiveX control if it does not exists on the client machine.
(note - the above discussed behavior is subjected to the web browser settings)

The standard way to redistribute ActiveX controls through web pages is to package the ActiveX control and every other required file into a CAB file. The CAB file should be published on a web site and the CODEBASE parameter of the OBJECT HTML tag must be used to specify the location from where the ActiveX control and the dependent files can be downloaded.

Example:

< object id="ctrl" width=472 height=327 classid="CLSID:19B50C95-6BB5-4DFD-B20C-5B9A61FA1C0D" CODEBASE="http://www.website.com/redistribution/ctrl.cab" >
< /object >

Microsoft IE versions 3.0 and later use the CODEBASE attribute of object HTML tag to detect which version of ActiveX Control is installed on a user's computer and download & install the newer version of ActiveX control from the location specified by CODEBASE onto the user's machine if user is using older version.

Example:

< object id="ctrl" width=472 height=327 classid="CLSID:19B50C95-6BB5-4DFD-B20C-5B9A61FA1C0D" CODEBASE="http://www.website.com/redistribution/ctrl.cab#version=9,0,115,0" >
< /object >

The numbers '9,0,115,0' specify which version of the ActiveX control is required to use web functionality it provides.

No comments: