Practical guidelines:
- Pracs are designed to introduce you to common programming concepts taught in this course.
- Each prac consists of any number of tasks, which may be assessed for marks when completed.
- Read the instructions given in the prac to see what should be the desired results. Sometimes hints may be given to guide you through the task, but for most of the time you're encouraged to research how to solve the problems yourself!
- Additional exercises have been created for each week's prac to give you more practice working in Visual Studio. These exercises will not be marked, but the tutor will check them for you. Remember this course is focusing on web services. These services have a high probability for re-use within later pracs.
- And of course, don't hesitate to ask the tutor if you need help!
Although the videos in these pracs have been designed for Visual Studio 2005, there are no differences in implementation for Visual Studio 2008.
There are 3 marks for this prac, allocated as follows:
- 1 mark for completing task 2.
- 2 marks for completing task 3.
Task 1: Our first C# application
Objectives:- Starting Microsoft Visual Studio 2008
- Creating and running a simple C# application
Task 2: Our first ASP.NET web service
Objectives:- Creating a simple ASP.NET web service and understanding how it works
- Creating an ASP.NET web application to consume the web service
- First contact with the Visual Studio web GUI designer
Instructions: Follow the Flash video embedded below. More experienced students can quickly skim through the video and jump straight into writing the code.
Task 3: Human Checker
Marks: 2Instructions: For this task, you will need to design a slightly more complex web application and web service without any visual aid. Try following the requirements given below, design a simple interface for the web application, and implement them accordingly. You shouldn't have to write any HTML for your interface, simply using the basic controls from Visual Studio's toolbox should be sufficient.
Requirements:
- A label, a text input field and a two submit buttons. One submit button will be associated with the label, and the other with the text field.
- By clicking the first button a web service named generateString() will be called that will create a ten digit randomly generated string. The string will be displayed in the label.
- When the second submit button is pressed the second web service checkHuman() will check if the string entered in the text field is the same as the string created by generateString(). If the string has not been generated, or text has not been entered into the text field, an error message should appear.
That's it for Practical 1!
Additional Exercises
Additional Task 1: Creating Basic Login Page
Instructions: You will need to design a web interface with as follows:- The front page will have 2 text boxes/fields for the username and password respectively.
- The textbox entering the password should be masked. (Hint: This can be done by altering one of the textbox's properties)
- There will be a submit button.
- The username and password are sent to a web service named CheckUserNamePassword(), which checks if the username and password are correct (Hint: Use if-else statements ).
- There must be at least some form of validation to show the error message if the password or username is incorrect.
- Finally, the correct username and password will allow the access to a welcome page with the username appearing "Welcome username".
Note: No database is required for this practical. You will just have to be sure there is some form of validation done in the web service.
