??去掉aspx页面上的Label控件如何用代码实现?

解决方案 »

  1.   

    你可以隐藏起来啊。用lbl.Dispose()应该也可以吧。
      

  2.   

    你可以隐藏起来啊。用lbl.Dispose()应该也可以吧。
      

  3.   

    选中控件   按Delete键
      

  4.   

    选中控件   按Delete键
    在代码中实现!!!!!!!!!!!!!!!!!!!!
      

  5.   

    试试这个:
    Sub Page_Load
      fnRemoveLabel( Page )
    End SubSub fnRemoveLabel( s As Object )
      Dim ctlControl As Control  For Each ctlControl in s.Controls
        If ctlControl.GetType().ToString()="System.Web.UI.WebControls.Label" then
    s.Controls.Remove( ctlControl )
    Else
    fnRemoveLabel( ctlControl )
        End If
      Next
    End Sub
      

  6.   

    选中控件   按Delete键强!!!!!!!!!!!!!!!!!
      

  7.   

    上面哪个例子是删除所有LABEL的,下面这个删除指定的:
    Sub Page_Load
      fnRemoveLabel( "labelname" )
    End Sub
    Sub fnRemoveLabel( n as String )
    Dim ctlControl As Control = FindControl( n )
    ctlControl.Parent.Controls.Remove( ctlControl )
    End Sub