Exercise 1

Create a C# ASP.NET WebForms Application

  • Add a common MasterPage
  • Display the current date and time in a label in yyyy-MM-dd hh:mm:ss format
  • Refresh the time using a timer event every 5 seconds Note: Make use of UpdatePanels throughout the exercises to minimize full page refreshes

Exercise 2

Add a content page (rounding.aspx) to the MasterPage from the previous exercise

  • Add a text-box for the user to enter a date time string
  • Add a Test button
    • Clicking on the submit will do client-side validation to ensure the input is in yyyy-MM-dd h:mm format
    • If the validation fails, show an alert and halt processing further
    • If the validation passes, round the input to the nearest 15 minutes on the server and display inside another label
  • The rounding logic should be in a business logic class
    • The method should take in a DateTime round it and return it as a DateTime
    • Write a series of unit-tests in a separate class to test the math:

Testing Examples

1. 2015-05-18 7:01 -> 2015-05-18 7:00
2. 2015-05-18 7:07 -> 2015-05-18 7:00
3. 2015-05-18 7:08 -> 2015-05-18 7:15
4. 2015-05-18 7:15 -> 2015-05-18 7:15
5. 2015-05-18 7:22 -> 2015-05-18 7:15
6. 2015-05-18 7:23 -> 2015-05-18 7:30

Exercise 3

Add another content page (timestamp.aspx) to the MasterPage

  • Add a Log Timestamp button
  • Add a simple one column grid
  • Clicking on the button will confirm with the user whether to log the Timestamp or not
    • If yes, add the current time from the MasterPage to the grid in yyyy-MM-dd hh:mm:ss format
    • If no, dont do anything Note: you dont need to persist the data

Exercise 4

Add a home page (default.aspx)

  • Show link buttons for rounding.aspx and timestamp.aspx pages
  • Clicking on the link button will navigate to each page
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.