是这样:我在引用控件的页面的pageLoad事件里这样写道:control.(control为引用控件的ID,点过小数点后,没有相关text的属性,?) 我该怎么做?

解决方案 »

  1.   

    添加声明:
    protected UserControl1 ctl;
    然后好像就可以用:
    ctl.Text = "...";try it.
      

  2.   

    TO;icyer()   我就是那样做的,先写一个声明,但ctl的属性里面没有关于text的属性,有其它的办法吗?
      

  3.   

    public Label ctl
    {
        Get
        {
              ctl=Your control in your UserControl;
         }
    }
    Then you can use XXX.ctl.XXXX in aspx files.
    对吧?是这意思吗?
      

  4.   

    楼上说的是用户控件还是自定义控件?另外上面写的ctl=....能不能举个例子来说一下?
      

  5.   

    你有没有定义好熟悉呀:
    public string Text
    {
      get { return Label1.Text; }
      set { Label1.Text = value; }
    }