开发者

ActiveX control is not displaying.Need to know Why?

开发者 https://www.devze.com 2022-12-12 06:17 出处:网络
Here I displayed the code.Suggest me,If anything wrong. namespace MyActivex { public interface AxMyControl

Here I displayed the code.Suggest me,If anything wrong.

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;
        }
    }
  }
}

After building this code,created the dll and registered it successfully.And my html page is,

<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#MyA开发者_Python百科ctivex.MyControl" 
  width=300 height=80>
 </object>
</body>
<script language="javascript">
 function doScript()
 {
  MyControl.UserText=frm.txt.value;
 }
</script>
</html>

I have placed my html page in the same folder where the dll exists.While opening the html page it displays as follows.Help me to find what is going wrong.If this is a simple and stupid issue, forgive me.I searched a lot for the solution but i didn't find.So that only posting here.

IE Snapshot http://img136.imageshack.us/img136/4948/snapshotzl.jpg


I know this may sound snarky but this could be a pop-up blocker getting in the way, make sure that is turned off. It can cause issues like this

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号