UPDATE – Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013 Tutorial Series


Visual Studio 2013 has been released with the latest update of .NET. We’ve updated and published our end to end tutorial series consisting of 10 tutorials on the ASP.NET web site:
Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013

This tutorial series guides you through the process of creating a complete web application. Each tutorial builds on the previous tutorial. When you’re finished, you’ll be familiar with common ASP.NET concepts, as well as many of the features available in ASP.NET 4.5.

1-05

 

The latest ASP.NET 4.5 features provided in this Web Forms tutorial series include the following:

  • A simple UI for creating projects that offer support for multiple ASP.NET frameworks (Web Forms, MVC, and Web API).
  • Bootstrap, a layout and theming framework that provides responsive design and theming capabilities.
  • ASP.NET Identity, a new ASP.NET membership system that works the same in all ASP.NET frameworks and works with web hosting software other than IIS.
  • Entity Framework 6, an update to the Entity Framework which allows you retrieve and manipulate data as strongly typed objects, access data asynchronous, handle transient connection faults, and log SQL statements.

Download the completed project

You can download a C# project that contains the completed tutorial.

Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013 – Wingtip Toys (C#)

Take the ASP.NET Web Forms Quiz

You can review key areas of this tutorial by taking the ASP.NET Web Forms quiz.

ASP.NET Web Forms Quiz

ASP.NET Web Form Quiz

 

Application Features

Features explained in this tutorial series include:

  • The Web Application Project (not Web Site Project)
  • Web Forms
  • Master Pages, Configuration
  • Bootstrap
  • Entity Framework Code First, LocalDB
  • Request Validation
  • Strongly Typed Data Controls, Model Binding, Data Annotations, and Value Providers
  • OAuth and OpenID
  • ASP.NET Identity, Configuration, and Authorization
  • Unobtrusive Validation
  • Routing
  • ASP.NET Error Handling

Application Scenarios and Tasks

Tasks demonstrated in this tutorial series include:

  • Creating, reviewing and running the new project
  • Creating the database structure
  • Initializing and seeding the database
  • Customizing the UI using styles, graphics and a master page
  • Adding pages and navigation
  • Displaying menu details and product data
  • Creating a shopping cart
  • Adding OpenID support
  • Adding a payment method
  • Including an administrator role and a user to the application
  • Restricting access to specific pages and folder
  • Uploading a file to the web application
  • Implementing input validation
  • Registering routes for the web application
  • Implementing error handling and error logging

Tutorial Series Table of Contents

  • Introduction and Overview
    • Introduction
    • Overview
    • The Wingtip Toys Sample Application
    • Prerequisites
    • Download the Sample Application
    • Tutorial Support and Comments
  • Create the Project
    • What you’ll learn
    • Creating the Project
    • ASP.NET Web Forms Background
    • Summary
    • Additional Resources
  • Create the Data Access Layer
    • What you’ll learn
    • Creating the Data Models
    • Building the Application
    • Summary
    • Additional Resources
  • UI and Navigation
    • What you’ll learn
    • Modifying the UI
    • Summary
    • Additional Resources
  • Display Data Items and Details
    • What you’ll learn
    • Adding a Data Control to Display Products
    • Displaying Products
    • Summary
    • Additional Resources
  • Shopping Cart
    • What you’ll learn
    • Code features in this tutorial:
    • Creating a Shopping Cart
    • Testing the Completed Shopping Cart
    • Summary
    • Addition Information
  • Checkout and Payment with PayPal
    • What you’ll learn
    • Adding Order Tracking
    • Adding Checkout Access
    • Enabling Logins from Other Sites Using OAuth and OpenID
    • Migrating the Shopping Cart
    • Integrating PayPal
    • Running the Application
    • Reviewing the Database
    • Summary
    • Additional Resources
    • Disclaimer
  • Membership and Administration
    • What you’ll learn
    • These features are included in the tutorial:
    • Adding an Administrator
    • Running the Application
    • Summary
    • Additional Resources
  • URL Routing
    • What you’ll learn
    • ASP.NET Routing Overview
    • Retrieving and Using Route Data
    • Running the Application
    • Summary
    • Additional Resources
  • ASP.NET Error Handling
    • What you’ll learn
    • Overview
    • Adding Error Logging Support
    • Using ELMAH
    • Summary
    • Conclusion
    • Additional Resources
    • Acknowledgements
    • Community Contributions

Feedback is welcome. You can post comments, questions, or feedback with the tutorial series, with the code sample, or right here!

— Erik Reitan
Web Platform and Tools Developer Content
This posting is provided "AS IS" with no warranties, and confers no rights.

Comments (14)

  1. Anas Ghanem says:

    Thanks.

    One comment regarding the adminpage.aspx for the wingtip toys sample. In the Add product handler, you should check Page.IsValid property before saving anything. This is to make sure that even if the client side validation was not triggered (JS disabled ?), the invalid records will not enter the database. It's better to mention this in the sample and not just rely only on the EF validation.

  2. Kash says:

    Excelent, Very easy and simple to develop store font web site based on your tutorial. Great job, Very usefull.

  3. jayirvin says:

    How can i modify the code to run on iis8 and sql server express

  4. Jorge says:

    Where is the ASP.NET MVC or Web API Version?

  5. ErikReitan says:

    Hi Jorge,

    For MVC, I'd recommend the following:

    Getting Started with ASP.NET MVC 5

    http://www.asp.net/…/getting-started

    MVC Music Store application

    http://www.asp.net/…/mvc-music-store

    For Web API, see:

    Getting Started with ASP.NET Web API 2 (C#)

    http://www.asp.net/…/tutorial-your-first-web-api

    – Erik

  6. Mark says:

    I've noticed from the comments of the PayPal section that several people are having trouble with this error message "Error 10002 Security Error Security header is not valid" When they test in Sandbox mode. I'm having the same problem.  My sandbox API username and etc. all appear to be correct.  What could be the issue?

    Thanks for the help!

  7. ErikReitan says:

    Hi Mark,

    You are correct about the API credentials being related to error 10002. Try verifying that your credentials for the username, password and signature are correct in the PayPalFunctions.cs file:

     public string APIUsername = "";

     private string APIPassword = "";

     private string APISignature = "";

    Each of these values must include the correct values from the PayPal sandbox environment. You might also try stepping through the code and determining if there are any extra error details that can help point out which 10002 error is occurring.

    Take a look at the following list of API errors, it may help:

    developer.paypal.com/…/errorcodes

    If all else fails, I would create a new PayPal developer test account and try the new credentials. I hope this helps.

    Erik

  8. Philip Adler says:

    For some reason, I keep getting and can't resolve the following errors:

    Error 3 'System.Web.UI.WebControls.GridView' does not contain a definition for 'Cells' and no extension method 'Cells' accepting a first argument of type 'System.Web.UI.WebControls.GridView' could be found (are you missing a using directive or an assembly reference?) C:UsersPhilipdocumentsvisual studio 2013ProjectsWingtipToysWingtipToysShoppingCart.aspx.cs 79 55 WingtipToys

    Error 2 Argument 1: cannot convert from 'System.Web.UI.WebControls.GridViewRow' to 'System.Web.UI.WebControls.GridView' C:UsersPhilipdocumentsvisual studio 2013ProjectsWingtipToysWingtipToysShoppingCart.aspx.cs 56 43 WingtipToys

    Error 1 The best overloaded method match for 'WingtipToys.ShoppinCart.GetValues(System.Web.UI.WebControls.GridView)' has some invalid arguments C:UsersPhilipdocumentsvisual studio 2013

    ProjectsWingtipToysWingtipToysShoppingCart.aspx.cs 56 33 WingtipToys

    Error 4 The name 'CartItemUpdates' does not exist in the current context C:UsersPhilipdocumentsvisual studio 2013ProjectsWingtipToysWingtipToysLogicShoppingCartActions.cs 113 45 WingtipToys

    Error 5 The name 'MyCart' does not exist in the current context C:UsersPhilipdocumentsvisual studio 2013ProjectsWingtipToysWingtipToysLogicShoppingCartActions.cs 115 50 WingtipToys

    I keep looking for a way to rectify these, but going through the code, and comparing printouts

    of your finished code to mine, I can't figure it out.

    Any ideas?

  9. ErikReitan says:

    Hi Philip,

    I would first check if your project is missing a reference to an assembly. Then, I would compare the entire project by using something like windiff.exe. Let me know if that helps. Thanks

    Erik

  10. Manuel Garcia says:

    Excelente. Es possible obtenerlo para Visual Basic. Muchas Gracias

  11. ErikReitan says:

    Hi Manuel,

    At the end of the tutorial series I include a link to James Chaney's Visual Basic download for Visual Studio 2012. The link to the code sample is:

    code.msdn.microsoft.com/ASPNET-45-Web-Forms-f37f0f63

    I hope this helps.

    Erik

  12. StevenLiekens says:

    Hey Erik

    Where were you trying to go with this code sample on page 80? I mean, besides trying to make me laugh.

    http://pastebin.com/0xBDc3yR

    All you really had to do was check the return value of 'TryParse'

    http://pastebin.com/1YCjnMJM

  13. Egil Ryengen says:

    Hi Erik – I have been advised by one in the Forum to address this issue here:

    1 Points

    12 Posts

    Re: Order values in Norwegian kr in the shopping cart but become dollars in the order that goes t…

    10-17-2014 09:34 AM|LINK

    Hi George

    I am going through the trial Wingtip Toys made by Erik Reitan and storing the solution locally. As far as I know, I have not done anything to get norwegian kr. It was dollar from the beginning. I am situation in Norway. So normally norwegian kr would be right. The paths locally is:

    Here is the first place where "kr" appears:

    https://localhost:44301/Category/Cars

    https://localhost:44301/ProductList

    https://localhost:44301/ShoppingCart

    This currency name follows the products the whole way until the button for PayPal in the shopping cart is clicked. Here the currency change.

    http://www.sandbox.paypal.com/…/merchantpaymentweb

    Hope you understand and can tell me the solution of this issue.

  14. notausstieg says:

    Hi Erik.  I am really enjoying your tutorials on ASP.NET 4.5 wingtip toys.  The only thing is I can't get passed an error, namely, Compiler Error Message: CS0246: The type or namespace name 'WingTipToys' could not be found (are you missing a using directive or an assembly reference?)

    It has to do with a code line in Site.Master:

    <a href="/ProductList.aspx?id=<%#: Item.CategoryID %>">

    The above line is shown as the source of the problem. I have tried spelling errors, assembly referencing but nothing seems to work. It builds ok though. Is that line ok? The CategoryID bit is not predicted in the intellisense.

    Any suggestions?

    Pablo

    pvent08@gmail.com