Figures
Figure 1 Simple ASP+ Web Form
<html>

<script language="vb" runat="server">

    Sub SubmitButton_Click(Source As Object, E As EventArgs)
        Response.Write ("You entered " & Name.text)
    End Sub

</script>

<body>

<form method="post" runat="server">

    Name: <asp:textbox id="Name" runat="server" /><br>

    <asp:Button text="Enter"
           OnClick="SubmitButton_Click" runat="server" />

</form>

</body>
</html>
Figure 2 Using a Server-based Control
<html>

<script language="vb" runat="server">
    Sub SubmitButton_Click(Source As Object, E As EventArgs)
        YouEntered.Text = "You entered " & txtName.text
    End Sub
</script>

<body>

<form method="post" runat="server">

    Name: <asp:textbox id="txtName" runat="server" /><br>

    <asp:Button text="Enter"
           OnClick="SubmitButton_Click" runat="server" />
    <br>
    <asp:label id="YouEntered" runat="server" />

</form>

</body>
</html>
Figure 3 Using Page Events
<html>
<script language="VB" runat="server">

    Sub Page_Load(Source As Object, E As EventArgs)
        ' code to run when page loads
    End Sub

    Sub SubmitButton_Click(Source As Object, E As EventArgs)
        ' code to run when button is clicked
    End Sub

    Sub Page_Unload(Source As Object, E As EventArgs)
        ' code to run when page unloads
    End Sub
</script>

<form runat="server">

  <asp:Button text="Enter" OnClick="SubmitButton_Click" runat="server" />

   <asp:label id="YouEntered"/>

</form>
</html>
Figure 4 DaveSGrid1.aspx
<%@ Import Namespace="System.Data.SQL" %>

<html>
<script language="VB"  runat="server">
  Sub Page_Load(Sender As Object, E As EventArgs)
    Dim myCommand As SQLCommand
    myCommand = New SQLCommand("select * from products",
                "Server=localhost; Database=AdvWorks; UID=sa")

    DataGrid1.DataSource = myCommand.Execute
    DataGrid1.DataBind
  End Sub
</script>

<body>
  <ASP:DataGrid id="DataGrid1" runat="server" />
</body>
</html>
Figure 5 DaveSGrid1.aspx Output
Figure 5 DaveSGrid1.aspx Output
Figure 7 DaveSGrid2.aspx
<asp:DataList id="MyDataList" RepeatColumns="2" runat="server">

  <template name="itemtemplate">

    <table cellpadding=10 style="font: 10pt verdana">
      <tr>
        <td width=1 bgcolor="BD8672"/>
        <td valign="top">
          <img align="top"
             src='<%# DataBinder.Eval(Container.DataItem, 
             "ProductImageURL") %>' >
        </td>
        <td valign="top">
          <b>Name: </b>
             <%# DataBinder.Eval(Container.DataItem, 
                 "ProductName") %><br>
          <b>Description: </b>
             <%# DataBinder.Eval(Container.DataItem, 
                 "ProductDescription") %><br>
          <b>Price: </b>
             <%# DataBinder.Eval(Container.DataItem, 
                 "ProductPrice", "$ {0}") %>
        </td>
      </tr>
    </table>

  </template>

</asp:DataList>
Page view tracker