.NET的ActiveX不工作的框架4.0 [英] .net activex not working in framework 4.0

查看:237
本文介绍了.NET的ActiveX不工作的框架4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经.net用户控件,我表现出来的asp.net页面对象。 如果用户控件的DLL的目标框架是3.5 - 一切正常。 如果我改变它到.NET 4.0 - 的activex不可见

I have .net usercontrol and I show it in asp.net page as Object. If the target framework of the usercontrol's dll is 3.5 - everything works. If I change it to .net 4.0 - the activex doesn't visible.

该用户控件是很简单的。这只是一个按钮和一个标签:

The usercontrol is very simple. It's just one button and one label:

[ComVisible(true)]
public partial class UserControl1 : UserControl
{
    public UserControl1()
    {
        InitializeComponent();
        label1.Text = "0";
    }
    private void button1_Click(object sender, EventArgs e)
    {
        label1.Text = Convert.ToInt32(label1.Text) + 1 + "";
    }
}

这是HTML code:

And this is the html code:

<object id="myControl2" name="myControl2"
    classid="http:ClassLibrary1.dll#ClassLibrary1.UserControl1" 
    width="300" height="350" />
</asp:Content>

为什么它不工作?

Why it's not working?

推荐答案

我一直在尝试相同的,发现如下:

I have been trying the same and found the following:

您无法再承载Windows窗体控件在Internet Explorer中,因为有托管在Web上控制更好的解决方案。因此,IEHost.dll和IEExec.exe组件已经从.NET框架除去。

You can no longer host Windows Forms controls in the Internet Explorer, because there are better solutions for hosting controls on the Web. Therefore, the IEHost.dll and IEExec.exe assemblies have been removed from the .NET Framework.

从这篇文章: http://msdn.microsoft.com/en-美国/库/ ee941656.aspx

这篇关于.NET的ActiveX不工作的框架4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆