Assignment 8

Logins

Instructions

For this assignment we will use the login control, but we will manually control the login by clicking on the login button and writing our own code.

Usernames and passwords will be stored in an xml file with the following structure:

<?xml version="1.0" encoding="utf-8" ?>

<calogins>

  <calogin>
    <username>jones</username>
    <password>pa$$w0rd</password>
  </calogin>

  <calogin>
    <username>Smith</username>
    <password>pa$$w0rd</password>
  </calogin>
  
</calogins>

When the login button is clicked the code should load the xml file into a dataset, and then loop through the dataset to see if any username or password matches the ones entered into the login control.

If a match is found the authenticated property should be set to "true," the username should be written to a Session variable and the user should be redirected to a welcome page.

If there is no match, the authenticated property should be set to "false."

Add code to the page load event of the welcome page that redirects a user back to the login page if they are not autenticated.

Grading

This assignment is worth 10 points

  • 4 points for the login control code
  • 2 points for the xml file
  • 4 points for the welcome page