1. how are you accessing the control? show some code?2. make sure you properly configured the permissions, see
http://windowsforms.net/articles/iesourcing.aspx

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script language=vbscript>
    sub bg()
    test.width=500   '这行可以工作
    test.TitleNew=" has been clear."  '这里提示错误,TitleNew为自定义属性
    end sub
    </script>
    </head><body>
    <object id="test" classid="http:DllTest.dll#DllTest.TestDll" width="150" height="150">
    </object>
    <form method="POST" action="--WEBBOT-SELF--">
    <p><input type="button" value="按钮" onclick="bg()" name="B3"></p>
    </form>
    </body>
    </html>上面是调用的网页以下为测试控件的原码:
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Windows.Forms;namespace DllTest
    {
    /// <summary>
    /// UserControl1 的摘要说明。
    /// </summary>
    public class TestDll : System.Windows.Forms.UserControl
    {
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Label label1;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null; public TestDll()
    {
    // 该调用是 Windows.Forms 窗体设计器所必需的。
    InitializeComponent(); // TODO: 在 InitComponent 调用后添加任何初始化 } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if( components != null )
    components.Dispose();
    }
    base.Dispose( disposing );
    } #region 组件设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器 
    /// 修改此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.button1 = new System.Windows.Forms.Button();
    this.label1 = new System.Windows.Forms.Label();
    this.SuspendLayout();
    // 
    // button1
    // 
    this.button1.Location = new System.Drawing.Point(32, 64);
    this.button1.Name = "button1";
    this.button1.TabIndex = 0;
    this.button1.Text = "button1";
    this.button1.Click += new System.EventHandler(this.button1_Click);
    // 
    // label1
    // 
    this.label1.Location = new System.Drawing.Point(24, 16);
    this.label1.Name = "label1";
    this.label1.TabIndex = 1;
    this.label1.Text = "the title";
    // 
    // TestDll
    // 
    this.Controls.Add(this.label1);
    this.Controls.Add(this.button1);
    this.Name = "TestDll";
    this.ResumeLayout(false); }
    #endregion private void button1_Click(object sender, System.EventArgs e)
    {
    if(this.BackColor==Color.Blue)
                    this.BackColor=System.Drawing.Color.Red;
    else
    this.BackColor=Color.Blue;
    } public string TitleNew
    {
    get
    {
    return this.label1.Text;
    }
    set
    {
    this.label1.Text=value;
    }
    } }
    }
    控件在网页中可以正确显示,且控件中的按钮工作正常,网页中的按钮在点击时,对于控件的自有属性可以工作(改变控件宽度),但自定义属性却无法工作,提示“控件不支持此属性或方法”
      

  2.   

    it works fine with me on localhost1. did you see the button/label displayed in the browser?
    2. what browser are you using?