EC512 Course Web Site
Skip Navigation Links

Lab 6
Due Friday Aug. 11 8 AM
NO LATE SUBMISSIONS ACCEPTED

Uploads will be disabled at 8 AM

The object of this assignment is to implement an online voting system and associated adminstrative features. The application will consist of two pages. The first (Default.aspx) will have a radio button list of candidates. After voting the user is taken to a second page where the current votes are displayed. The following are more details about each page and the database design.

Database

The database consists of one table with two columns in addition to the Id primary key. The first column is the name of a candidate and the second is an integer column of the current vote count. The table is initialized  with as many candidates as you want. Each should have zero votes. For testing you can initialize the table manually until you get the administrative features running.

When you submit your assignment pleas give me a clean database with three names and zero votes. The names should be "Candidate 1" through "Candidate 3."

Voting Page

The voting page consists of a radio button list control that is databound to the table. It adjusts for any number of candidates. No button should be selected initially.

A suitably labeled button is provided for voting. After the user selects the candidate and votes he/she is taken to the second page named Votes.aspx. If a user attempts to vote with no selection an error is indicated and the user remains on the same page.

Current Votes Page

On this page is a thank you for voting and the current votes and percentages for each candidate.

This data must be displayed in a neat tabular format with a heading row with labels: Candidate, Votes, and Percentage.

 Remember that the table size needs to adjust to the number of candidates without modifying any code. Use the dynamically generated table as I showed in the repeater example in class and on the course web site.

The DataView class is quite useful for this assignment to obtain the vote counts in oreder to calculate the percentages. Refer to my lecture slides.

Administrative features

For administration you will use windows forms based security as covered in class. The administrative page MUST be placed in a private folder that is protected by a username and password. It should be named Admin.aspx and a link provided on the voting page using a button. The username should be"admin" and the password should be "manage" and set up in the web.config file. Just duplicate the techniques in the slides. DO NOT include an option to remember the credentials. This must always be false.The management page must support the following features:

  1. Add a candidate with zero votes.
  2. Delete a condidate.
  3. Reset all votes to zero.

CSS styling and static content is expected. Make the pages look good.

Be sure to zip your entire web site before submitting online. Do not include unnecessary files.