代码如下:  
             if  (dltPublicTable.Visible==  false)  
           {  
                                                             
                       this.dltPublicTable.Visible=true;  
           }  
             else  
           {  
                       this.dltPublicTable.Visible=false;  
           }  
我是在ascx中调用以下代码的,但是每次它都要初始化dltPublicTable.Visible为True,  
晕了,如何才能控制它的属性??

解决方案 »

  1.   

    if(!IsPostBack)
    {
               if  (dltPublicTable.Visible==  false)  
               {  
                                                                 
                           this.dltPublicTable.Visible=true;  
               }  
                 else  
               {  
                           this.dltPublicTable.Visible=false;  
               }  
    }
      

  2.   

    呵呵,楼上的各位大虾们,你们的意见还是不行,我是想通过点击ascx中的某一个按钮而实现自动显示或隐藏,所以各位的方法,不中!