|
ASP.NET Due 11:59pm on Friday, December 8 This assignment will focus on building a simple web application. When a user connects to the webpage that you design, he or she will be able to choose a favorite movie (or music group, or pizza topping, or sport, or whatever -- you decide) from a fixed list of choices, and then see the result of the overall vote, i.e. the result of all users who have submitted a vote so far. Once a user has submitted a vote, he or she is not allowed to do so again (at least not during the same session). The computer that holds your CS112 files (namely "m:" on the CS-112 servers) is also a web server, so you will be able to run your program from any computer having Internet access -- that's the point of web services. There is one caveat in this assignment: VS.NET will not work in developing your program! There are a couple of technical reasons for this, but the bottom line is that you will have to rely on the error messages generated by the web browser when running your program in order to debug it. I suggest using WordPad to actually create and edit your files. Note: In order for error messages to appear in your browser, you must tell the web server to allow them to be displayed. To do that, create a file called "web.config" in the same directory that you are creating your solution (see below). This file should contain the following code:
<configuration> In terms discussed in the textbook, your program will utilize "code behind", will communicate to the server via "post data", and will implement "session tracking". It will not implement a "three-tier architecture", however, because we have not learned about databases. Instead, it will simply write to a file. Although your program will be very simple, it should nevertheless give you a good feel for how these things work in the real world. More specifically, your webpage should have the following components:
Note: a key thing to remember is that HTTP sessions are stateless -- everything you need to remember about a session must be explicitly stored somewhere. In this application, there are two pieces of state that need to be remembered:
The result of your assignment should be two files:
You should create these files using WordPad in the top-level of the m:/ directory in your account. Do not put the files in the Visual Studio Projects folder. If you do, the web server will not be able to "see" them, and they will not execute properly. I suggest creating the ASP file first, and get the "look and feel" of the webpage to be correct. Then you can add the C# file to get the dynamic behavior to work correctly. In order to run your program, just type the following URL into your favorite browser: http://plucky.cs.yale.edu/CS112ASP/netid/Vote.aspx where "netid" is your netid. Plucky is the machine that actually holds the "m:" drive on the CS112 servers, and the above URL is how your folder is accessed via the Internet (i.e. via HTTP). The Firefox browser has now been installed on all of the CS112 servers, so you can use it to test your programs without logging off of the servers. Final comment: This is the first time I have given a web-application assignment in this course, so please let me know if you run into any problems, and please stay tuned to this website for updates or hints. |