1
这里我显示了code.Suggest me,如果有什么不对。ActiveX控件不显示。需要知道为什么?
namespace MyActivex
{
public interface AxMyControl
{
String UserText { set; get; }
}
public partial class MyControl : UserControl,AxMyControl
{
string mystring;
public MyControl()
{
this.InitializeComponent();
this.Show();
//InitializeComponent();
}
public string UserText
{
get { return mystring; }
set
{
mystring = value;
textBox1.Text = value;
}
}
}
}
构建此代码后,创建的DLL并将其注册successfully.And我的HTML页面,
<html>
<body>
<form name="frm" id="frm">
<input type="text" name="txt" value="enter text here">
<input type="button" value="Click me" onClick="doScript();">
</form>
<object id="MyControl" name="MyControl" classid="MyActivex.dll#MyActivex.MyControl"
width=300 height=80>
</object>
</body>
<script language="javascript">
function doScript()
{
MyControl.UserText=frm.txt.value;
}
</script>
</html>
我已经把我的HTML页面在同一个文件夹中的dll exists.While开幕它显示的HTML页面如下。帮助我找到问题所在。如果这是一个简单而愚蠢的问题,请原谅我。我搜索了很多的解决方案,但我没有找到。因此,只在这里发布。
IE Snapshot http://img136.imageshack.us/img136/4948/snapshotzl.jpg
我关闭弹出窗口阻止程序,但仍然会发生同样的问题。 – Babu 2009-11-26 04:03:15