what is IDCheck? is that the codebehind class for your user control?

解决方案 »

  1.   

    yes属性怎样传递给user control呢?
      

  2.   

    公开属性username和password的定义如下:public string username;
    public string password;msdn上就是这样做的。
      

  3.   

    do you have something like<cc1:whatever id="IDCheckControl" runat="server" />in your webform.aspx? show your aspx code
      

  4.   

    你这里声明的用户控件类的对象id:
    protected IDCheck IDCheckControl; 
    要跟aspx页面上的:
    <cc1:whatever id="IDCheckControl" runat="server" />
    id要是一致的才行
      

  5.   

    <cc1:whatever  id=  "IDCheckControl  "  runat=  "server  "  /  >我在codebehind里自己定义的控件实例,与webform.aspx里的id名不一样,只要改成一样就可以了。