Layout controls in an asp:Table : Table « Asp Control « ASP.Net






Layout controls in an asp:Table

<%@ Page Language="vb" %>
<html>
<head>
   <title>Display Control Example</title>
   <script runat="server">
      Sub Page_Load()
         MyLabel.Text = "New Label"
         MyImage.ImageUrl = "http://www.java2s.com/style/logo.png"
      End Sub
   </script>
</head>
<body>
   <h1>Display Control Example</h1>
   <form runat="server">
      <asp:table id="MyTable" border="1" cellpadding="5" cellspacing="0" runat="server">
         <asp:tablerow runat="server">
            <asp:tablecell colspan="2" runat="server">
               Table Control
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               Label Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:label id="MyLabel" 
                  text="This is a Label Control"
                  borderstyle="solid" 
                  bordercolor="Green" 
                  runat="Server" />
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               Image Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:image id="MyImage" 
                  imageurl="image.jpg" 
                  runat="Server" />
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               Panel Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:panel id="MyPanel"
                  backcolor="lightblue"
                  bordercolor="Green"
                  borderwidth=1 
                  runat="server">            
                  <asp:label id="MyLabel2" 
                     text="Static Text within the Panel" 
                     runat="Server"/>
                  <br>
                  <asp:textbox id="PanelTB" text="TextBox inside Panel" runat="Server"/>
               </asp:panel>
            </asp:tablecell>
         </asp:tablerow>
      </asp:table>
   </form>
</body>
</html>

           
       








Related examples in the same category

1.Add row to asp:table
2.asp:table with static data
3.Add asp:tablecell
4.Table Footer Row