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