Page.HasControls property : Controls On Page « Page « ASP.Net






Page.HasControls property

<%@ Page Language="vb" %>
<html>
   <head>
      <title>HasControls method example</title>
      <script runat="server">
         Sub Page_Load()
            If Page.HasControls = True Then
               Message.Text = "The page contains controls."
            Else
               Message.Text = "The page does not contain controls."
            End If 
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>
           
       








Related examples in the same category

1.Add asp control to page dynamically
2.Find Control in a page
3.Add control by index