<%@LANGUAGE="VBSCRIPT" %> <% Response.CacheControl = "no-cache" %>
Assign01

This lab is just a little exercise to get you oriented to this semester's setup. It is mainly a quick way to get everybody set up on the server and ready for the semester. Read everything carefully. You might want to read it twice; you're going to be doing everything on this page repetitively for the rest of the semester.

  1. About your account
    • You will be assigned a storage space on Professor Glotzbach's server. Practice accessing the space. Learn how to map the drive. From off campus, you will likely have to enable VPN in order to access the drive.
    • Do NOT delete any of the folders in the space you are given! If you delete or rename a folder, you remove all of the server settings for that space. Lab, Project, and development space folders are provided. You are not allowed to delete or modify these folders. You can add/delete/modify folders and pages inside of any of those folders however.
    • Only you will be able to view your materials. Other students will not be able to view your materials. The instructor also has access to view your materials.
    • Keep in mind - After this semester, all files will be removed from the server storage space. This means you must backup your files in another location. As good practice, you should always backup your files in another location. Files will not be saved under any conditions. Once this class is over, you must find your own storage space.
       
  2. Create this batch file
    • Open Notepad
    • Copy and paste the following two lines. Change the drive letter (only if necessary), <yourFolder>, <yourPass>, and <yourLogin> to those that were assigned to you (instructor will explain):

      echo off
      net use v: \\128.210.136.241\<yourFolder> <yourPass> /user:<yourLogin> /persistent:no
       
    • Save as "ConnectDrives.bat"
       
    • If you are on campus (on the Purdue network), you can simply double click the .bat file to map your web server space. It will appear under Computer as a new drive letter. If you are off campus, you will first need to enable your VPN, then double click the .bat file.
       
    • This file may be of help to Mac users (Mac users will have to connect differently):
    • Copy the file to your H drive so you don't lose it.
    • Leave a copy on your desktop (if you can) so that after windows loads, you can double click it.
       
  3. Get used to testing in multiple browsers. The browser you are using may not be what your end client is using.
     
  4. Create your first ASP.NET web application
    • File > New Project...
      • Language: Visual C#
      • Select ASP.NET Web Application
      • Select OK
      • Select Empty and make sure "add folders and core references for" Web Forms is checked
      • Select OK
    • Location: You can save it to your local machine and then copy it over to the server later.
    • Do: Build > Build Solution (builds the entire solution) -- shortcut: Ctrl+Shift+B
    • Do: Build > Rebuild Solution (rebuilds the entire solution) -- because once apparently isn't enough
    • Notice the text scrolling through the Output area at the bottom
      • Don't see an Output area? View > Output
        • If the build succeeded, then the application is ready to be published and looked at in a browser
      • To view in a browser:   http://cgtweb1.tech.purdue.edu/456/<yourid>/Assign01/<yourFileName>.aspx
        • Notice that 456 is in this URL
    • The file extension you navigate to in the browser is .aspx
      • other technologies have had you use .php and .html, this class will be .aspx
         
    • If you are missing a window within Visual Studio, they are all located under the View menu. Some are nested under View > Other Windows. You will definitely want to have open the Solution Explorer, Properties, Output and sometimes Server Explorer.
    • In Solution Explorer, click the plus sign to expand your aspx file to reveal an aspx.cs file. This .cs file called a Code Behind file. The cs stands for C# (C Sharp). Open both the .aspx and the .aspx.cs files by double clicking on them.
    • In Solution Explorer, Right click the .aspx and choose Rename. Name it Assign01.aspx
      • Notice that the name changed for both the aspx and the aspx.cs and the filenames are correctly displayed in the tabs along the top of the open pages.
    • Build > Build Solution or use Ctrl + Shift + B to Build the solution. It should build successfully.
    • Look at the .cs file code
      • Your namespace has the same name as your solution. Visual Studio does this by default. Visual Studio hides this information because all files in the same solution are automatically considered to be in the same namespace.
      • A namespace is used in programming to prevent name collisions because so many apps have similar code.
      • Notice that your class name is the same as what your page used to be named. Change the class name to FirstLab
        Class names should always begin with a capital letter.
      • Ctrl + S to save it or Ctrl + Shift + B to build it (which also saves it).
      • Notice in the .aspx file code, first line, inherits="YourAppName.FirstLab" If it does not say FirstLab, change it so that it does. An explanation of that line is: this aspx inherits objects from the FirstLab class inside of the Assign01 namespace. Or in pseudocode: inherits="class"
    • Add a new aspx
      • Right click on the solution name (bold) > Add > New Item...
      • Make sure you are within C#
      • Make sure you are within Web
      • In the middle, select Web Form
      • In the Name box, name it schedule.aspx
      • Language should always be C#
      • Click Add
      • Notice the page is added to Solution Explorer and the .cs is automatically generated for you.
         
    • Assign01.aspx
      • List your full name and your email address, but nothing personal about you.
      • List definitions for the terms: 1)Object Oriented Programming, 2)Class, 3)Inheritance, and 4)Namespace.
      • Provide a link to schedule.aspx
      • Inside Assign01.aspx.cs, inside the Page_Load function, add a line of code that writes out the text "From Page_Load" to the browser. Hint: Response.Write()
    • schedule.aspx
      • Create your weekly schedule in table format (can be any schedule, not your personal schedule).
      • In the aspx, use <asp:Table >, <asp:TableRow>, etc, and any other <asp:xxx> controls that will help you to build your schedule.
    • Build your solution and check your pages by viewing them in the browser.
    • Lastly, before you close Visual Studio, always do this to ensure all files are saved:
      • Build > Rebuild Solution
      • File > Save All
    • Save backups to your own drive in case of a web server crash.
       

Grading

Definitions 5
Lab 1 site 5 pts
Total 10 pts