Database Storage with the ASP.NET Web Matrix: Simple Login Page - Start with the Properties pane
(Page 2 of 5 )
Using the Properties pane at the far right of the Web Matrix (just below the Data pane), set the Text value of the first label to Username: then set the ID value of the textbox to txtUsername. Set the ID of the label after the textbox to lblUsernameError and clear the Text value. Now set the Fore color to red.
Move down to the next line and set the Text value of the first label to Password: then set the ID value of the textbox to txtPassword. Set the ID value of the label following this textbox to lblPasswordError, clear the Text value and again set the Fore color to red.
Move down to the button and set the ID value to btnSubmit and the Text value to Submit. Finally, move down to the last label control and set the ID value to msgWelcome, set the Fore color to green and clear the Text value.
These are the only visual elements we will need. Your page should look a little like this:

In the previous example, we used an INSERT function to write the information submitted by the user to the database. In this example, we will use a SELECT function instead to read the contents of the database. In fact, we will use two SELECT functions, one to read the first column of the database (username) and one to read both the first and second columns (username and password).
Next: Switch to the Code view >>
More Database Articles
More By Dan Wellman