WINFORM控件是用vb.net写的,form界面中只有一个button控件。控件网页文件代码如下,其中WindowsControlLibrary1.dll为控件文件名,WindowsControlLibrary1为控件命名空间,UserControl1为控件类名。网页文件和此控件均放在虚拟根目录下,有读、脚本运行等权限。问题是:当启动此网页时,控件显示出来就像textbox一样(实际是form中有一个按钮),当单击网页中的按钮时除在状态栏显示“网页上有错误”外并没有其它反应。
--button控件代码
Public Function PMsg()
MessageBox.Show("HELLO WORLD!")
End Function
--网页代码
<HTML>
<script language="JScript">function runExe()
{
USerControlLibrary1ID.PMsg();
}
</script> <BODY>
<input type="button" value="runExe1" onclick="runExe()">
<OBJECT id="USerControlLibrary1ID" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"
height="500"
width="500" >
</OBJECT>
</BODY>
</HTML>
--button控件代码
Public Function PMsg()
MessageBox.Show("HELLO WORLD!")
End Function
--网页代码
<HTML>
<script language="JScript">function runExe()
{
USerControlLibrary1ID.PMsg();
}
</script> <BODY>
<input type="button" value="runExe1" onclick="runExe()">
<OBJECT id="USerControlLibrary1ID" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"
height="500"
width="500" >
</OBJECT>
</BODY>
</HTML>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货