Deploying a UserControl with an ActiveX control in Internet Explorer

Has anyone had any success deploying a windows form usercontrol with an activex control embedded in it on an html page in Internet Explorer.

I have a strong named active x control and a strong named user control. I have added the object tag correctly to refer to the <<assembly#namespace.usercontrol>> and get a blank screen.

<object id="PlotControl" classid="http:./forms/PrototypeWork.dll#PrototypeWork.UserControl1" 
width="100%" 
height="100%" 
VIEWASTEXT></object>



Do I need to add another object tag to get the embedded activeX control downloaded

Do I need to PInvoke the ActiveX Control in the user control 

Any ideas.
Arthur


Answer this question

Deploying a UserControl with an ActiveX control in Internet Explorer

  • jvanulden

    To use an ActiveX control in Windows Forms, you will need Unmanged Code permission.  This permission is only in the local machine default permission set.  The other common default permission sets (internet and intranet) do not have this permission and will throw a security exception when attempting to load the ActiveX control.  

    To get around this, you should add an entry in the machine's security policy (use caspol.exe or the Common Language Runtime's configuration tool) for your strong name key with Unamanged Code Permission.

    Of course, judging from the error you're seeing, you have a more basic problem, it appears that your managed assembly isn't loading.  I'd try removing the relative pathing you've added to the classid tag after the "http:".

    good luck
     - mike

  • Deploying a UserControl with an ActiveX control in Internet Explorer