6.9. Web forms’ internals

In this section we will look at how the web form is created by ASP.NET. Let’s create a simple form that contains two fields and a button (see Figure 6.14). The code for this form is shown below.

Figure 6.14. A simple web form with two fields and a button

 <html> <body> <form id="login" runat="server"> <center> <table width="50%"> <tr> <td>User name</td> <td> <input type="text" runat="server" id="uname"> </td> </tr> <tr> <td>Password</td> <td> <input type="password" runat="server" id="pass"> </td> </tr> <tr> <td colspan="2" align="right"> <input type="submit" value="Ok" id="ok" runat="server"> </td> </tr> </table> </center> ...

Get A Programmer's Guide to .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.