Wednesday, February 24, 2010

Week 3

This week we looked at websites where you can buy things. Everyone picked one website and then gave a presentation about the process of buying something from that site and also any useful features that they have. I chose ebay and looked at their process. I like the simplicity of their sign up form and their organization of all the items available.When you search for something you can refine the search down and get very specific about what you're looking for. When purchasing a product they have a number of confirmation pages to stop people from accidentally buying something. Their design is also simple with lots of breathing space.
After our presentations we continued with the website from last week. We added hyperlinks to the categories within the grid view to allow a category to be chosen. We then added a second table to our database to contain a list of products available for sale. A new class was also created to manage the products.

Tuesday, February 23, 2010

Online Store

Home Page
 
Within A Category
 
Search Results

Item View

Sign In

Register

Review Item

Final Confirm Of Purchase

Wednesday, February 17, 2010

Week 2

This week we began looking at SQL Server and reviewed database operations. We were also guided through the beginnings of creating a website that uses a SQL database. We had to create a simple design for a 3 div layout, header, categories and main content. Once the base structure of a page was coded it was duplicated for a number of pages. We then created a SQL database in Visual Studio. This was a simple a database with a single table containing all the categories available. This was then added into the web page in a grid view pulled from the toolbox.

Wednesday, February 10, 2010

Week 1

This week we began our Diploma course. We started a refresher of last years programming code. We covered the basics and refreshed class diagrams and how to code and call a class. We also began looking at response requests, query strings and sessions. These both allow data to be passed from one web page to another within the site.

Tuesday, February 9, 2010

Sessions

Sessions allow variables to be created in a webpage and to be accessed by another webpage within an application. However they only last for a matter of minutes.
To create a session you use the code: Session("Name") = "Value"

To access a session you use the code: lblSession.text = Session("Name")
To make sure an session does exist and to avoid errors you can use an if statement.
For example:
If Session.Item("Name") IsNot Nothing Then
Response.Write(Session("Name"))
Else
Response.Write("Session Name does not exist")
End If

Querystrings

Querystrings can be used to send information from one webpage to another.
The code to send the data is:

Response.Redirect("confirm.aspx?FirstName=" & txtFirstName.Text)
confirm.aspx is the page url; the ? denotes the start of the query; FirstName is the field name and the txtFirstName is where the fields data is stored.
Any subsequent field names begin with an &.

The code to receive the data is: Request.QueryString("FirstName") which simply uses the field name to identify what data you are asking for.