Once VS2015 is configured to build C# projects, create a new Visual C#, ASP.NET Web application. Select Web Forms

Similar documents
20486-Developing ASP.NET MVC 4 Web Applications

Developing ASP.NET MVC 5 Web Applications

Programming Fundamentals of Web Applications

ASP.NET MVC Training

20486 Developing ASP.NET MVC 5 Web Applications

20486: Developing ASP.NET MVC 4 Web Applications (5 Days)

Implementing a Numerical Data Access Service

Java Swing Introduction

XML. Jonathan Geisler. April 18, 2008

Participation Status Report STUDIO ELEMENTS I KATE SOHNG

CSE 341, Autumn 2015, Ruby Introduction Summary

Course 20486B: Developing ASP.NET MVC 4 Web Applications

Developing ASP.NET MVC 5 Web Applications

Developing ASP.NET MVC 4 Web Applications

Developing ASP.NET MVC 5 Web Applications. Course Outline

Microsoft Developing ASP.NET MVC 4 Web Applications

Visual Studio Course Developing ASP.NET MVC 5 Web Applications

ORB Education Quality Teaching Resources

Write for your audience

COURSE 20486B: DEVELOPING ASP.NET MVC 4 WEB APPLICATIONS

SCRIPT REFERENCE. UBot Studio Version 4. The Browser Commands

Web Site Design and Development Lecture 24

Building Effective ASP.NET MVC 5.x Web Applications using Visual Studio 2013

Developing ASP.NET MVC 4 Web Applications

20486: Developing ASP.NET MVC 4 Web Applications

Presentation and content are not always well separated. Most developers are not good at establishing levels of abstraction in JSPs

Adobe Fireworks CS Essential Techniques

20486C: Developing ASP.NET MVC 5 Web Applications

G52CPP C++ Programming Lecture 7. Dr Jason Atkin

Developing ASP.NET MVC 4 Web Applications

Oracle Developer Day

Café Soylent Green Chapters 4

Developing ASP.Net MVC 4 Web Application

Exploring.Net Orcas. Contents. By Punit Ganshani

Vb Net Tutorial For Beginners Visual Studio 2010 Create Web Service

Read & Download (PDF Kindle) Prolog Programming; Success In A Day: Beginners Guide To Fast, Easy And Efficient Learning Of Prolog Programming

Next Generation LMS Evaluation

Dreamweaver Basics Workshop

frameset rows cols <frameset> rows cols

Creating an Online Catalogue Search for CD Collection with AJAX, XML, and PHP Using a Relational Database Server on WAMP/LAMP Server

Introduction to Web Concepts & Technologies

Architectural Engineering Senior Thesis CPEP Webpage Guidelines and Instructions

CST272 Getting Started Page 1

Address book. Presenting the Java assignment about an Address Book v

G52CPP C++ Programming Lecture 9

Creating the Data Layer

CIS 3308 Web Application Programming Syllabus

Fish Eye Menu DMXzone.com Fish Eye Menu Manual

heléne creative solutions LABOUR OF LOVE

HTML 5 Form Processing

Evaluation Guide for ASP.NET Web CMS and Experience Platforms

Building Responsive Websites

Head First HTML 5 Programming: Chapter 3: Events, Handlers, and all that Jazz.

React. HTML code is made up of tags. In the example below, <head> is an opening tag and </head> is the matching closing tag.

Web API Lab folder 07_webApi : webapi.jsp your testapijs.html testapijq.html that works functionally the same as the page testapidomjs.

Launch Store. University

Creating Simple Links

The Internet. Tim Capes. November 7, 2011

JavaScript: The Definitive Guide

Objects and Classes. Basic OO Principles. Classes in Java. Mark Allen Weiss Copyright 2000

Java Server Page (JSP)

CS18000: Programming I

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 19 Introduction to C++

Furl Furled Furling. Social on-line book marking for the masses. Jim Wenzloff Blog:

All India Council For Research & Training

Exam Ref Developing ASP.NET MVC Web Applications (2nd Edition)

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

[2:3] Linked Lists, Stacks, Queues

the gamedesigninitiative at cornell university Lecture 7 C++ Overview

ASP.net. Microsoft. Getting Started with. protected void Page_Load(object sender, EventArgs e) { productsdatatable = new DataTable();

Lab 5: Dreamweaver CS5, Uploading your Web site

Chapter 3 How to use HTML5 and CSS3 with ASP.NET applications

COMP 250 Winter 2011 Reading: Java background January 5, 2011

SCRIPT REFERENCE. UBot Studio Version 4. The UI Commands

Exceptions. Errors and Exceptions. Dealing with exceptions. What to do about errors and exceptions

Creating an HTML file (Mac)

Introduction What is Android?

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB!

CS 351 Design of Large Programs Coding Standards

Angular 2 and Hexo. Static Meets Dynamic For the Best of Both Worlds! Copyright 2016 Code Career Academy

Outline. Announcements. Feedback. CS1007: Object Oriented Design and Programming in Java. Java beans Applets

CS Problem Solving and Object-Oriented Programming

About the Tutorial. Dreamweaver MX overview

1. I NEED TO HAVE MULTIPLE VERSIONS OF VISUAL STUDIO INSTALLED IF I M MAINTAINING APPLICATIONS THAT RUN ON MORE THAN ONE VERSION OF THE.

Fusion-powered EDSLs

Clear Cache Internet Explorer 8 Window Xp Sp3

Week - 01 Lecture - 04 Downloading and installing Python

Reversing. Time to get with the program

CS 147: Computer Systems Performance Analysis

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Hello! ios Development

CS332, Norman October 2, Assignment: Layer 2

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer ASP.NET WP

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

10264A CS: Developing Web Applications with Microsoft Visual Studio 2010

Creating your first JavaServer Faces Web application

OBJECT-ORIENTED DESIGN

Naresh Information Technologies

Human Computer Interaction Lecture 08 [ Implementation Support ] Implementation support

Widget Toolkits CS MVC

Transcription:

Once VS2015 is configured to build C# projects, create a new Visual C#, ASP.NET Web application Select Web Forms

Update the authentication method to No Authentication (if you want, but highly recommended)

Deselect the option to host the application in Azure (if you have an account then by all means host it for real, but for the purposes of this class, everything can be local) VS will now create a framework for your project. Feel free to browse around what VS created for you by running the application: Microsoft does us a large favor in that it builds a cross platform (browser and mobile friendly) application with a built in home page, about page, and Contact page. All of these can be changed and altered, but for the purposes of this project, you can just remove them or use them to add your

information. It also builds out a base CSS package that, while very Microsoft, still looks professional and nice (read, good enough for the purposes of your class project). VS offers a drag and drop style of webpage building for aspx type pages as well as the HTML style view. Every aspx page as CodeBehind file (usually pagename.aspx.cs) in which you can implement cs functionality to interact with the page. To implement interactions (i.e. buttons), simply drag a button

into the working space and double click. VS will build out the methods necessary and direct you to the new event handler. Aspx has a lot of really neat features to implement a fully modern and functional website. C# is very much like Java in its syntax, capabilities, and methods. For the rest of this rough overview, I will be using the project I created for this class.

In order to achieve a good software architecture, it is important to build a class library outside of the UI implementation. To add a library, right click on the solution name, add, new item. Then select Class Library (naming it SolutionNameLib or whatever naming convention you d like). The first class I d recommend making is a DBConnect Class that can handle the process to connect and disconnect to your database. This will simply your code in other places for a cleaner implementation. When building your classes, think of three main categories: What does your class contain (data relating to the object itself)? Is there related data involved? And What do I want my class to be able to do? The data in your class should have a direct correlation to the database tables (id, name, etc). These should be private members of your class and accessible through setters and getters

Fancier implementations will have flags in a base class to represent whether or not the object has been changed or not (I did not do this because I am lazy). The benefit of this being that if the object has not changed since being returned from the database, there is no reason to waste time saving it. Related objects can be considered to be lists or other objects related to the original, but not necessarily the original object (i.e. A person can write books. Person would be the original, and books would be a list inside of the object). The List object in C# is very flexible and works as an array or vector. The final section refers primarily to the class s interactions with the database. At a basic level, every class should be able to be Saved, Loaded, and Deleted. I Highly Highly Highly recommend using stored procedures for all of your interactions with the database. They offer much higher levels of security, flexibility, and power when it comes to your application. Let s look at a Save functionality for one of my classes Once you are ready to use your classes in your UI, simply add using <LibraryName>; to the top of the aspx.cs pages.

We start off by creating a new connection. Since we put the implantation for this in the DBConnect class, we don t have to worry about that. Next we create a new command using our stored proc savereview and the connection. We set the command type to stored procedure and add the parameters of the procedure. I store parameter names inside the class itself as a subclass CritKeys so I know the names exist in one and only one place per class. The power of stored procedures allows the database to handle creating a new object or saving over an existing one through the use of the id. Since my constructor sets the default id to 0, the stored proc knows to create a table entry and return the new id when we execute the stored procedure, otherwise update.

Finally we close the connection while maintaining the object. If the save creates a new entry, the id will be updated, if not the same id will be returned. This could also be used for error checking, but it s not implemented here. In order to simply code in this area, I d also recommend creating a hydrate method that can be called to build out objects when selecting data from the database. So the code in the load method looks like this Which is very clean and simple. The hydrate method takes the datarow from the database and parses the row into an object for return. This parsing can be done via column name or index, but I find name to be more resilient and less dependent on the programmer.