What You'll Learn:: Create The Project
What You'll Learn:: Create The Project
This tutorial series will teach you the basics of building an ASP.NET Web Forms application using
ASP.NET 4.5 and Microsoft Visual Studio Express 2013 for Web. A Visual Studio 2013 project
with C# source code is available to accompany this tutorial series.
In this tutorial you will create, review, and run the default project in Visual Studio, which will
allow you to become familiar with features of ASP.NET. Also, you will review the Visual Studio
environment.
3. Select the Templates -> Visual C# -> Web templates group on the left.
4. Choose the ASP.NET Web Application template in the center column.
5. Name your project WingtipToys and choose the OK button.
Note
The name of the project in this tutorial series is WingtipToys. It is recommended that
you use this exact project name so that the code provided throughout this tutorial series
functions as expected.
6. Next, select the Web Forms template and chooks the Create Project button.
The project will take a little time to create. When it’s ready, open the Default.aspx page.
You can switch between Design view and Source view by selecting an option at the bottom of
the center window. Design view displays ASP.NET Web pages, master pages, content pages,
HTML pages, and user controls using a near-WYSIWYG view. Source view displays the HTML
markup for your Web page, which you can edit.
In addition to the four main development frameworks, ASP.NET also offers additional
technologies that are important to be aware of and familiar with, but are not covered in this
tutorial series:
ASP.NET Web API – A framework for building HTTP services that reach a broad range of
clients, including browsers and mobile devices.
ASP.NET SignalR - A library that makes developing real-time web functionality easy.
Visual Studio creates some initial folders and files for your project. The first files that you will be
working with later in this tutorial are the following:
File Purpose
Default.aspx Typically the first page displayed when the application is run in a
browser.
Site.Master A page that allows you to create a consistent layout and use
standard behavior for pages in your application.
2. Once you have completed review the running application, close the browser window.
There are three main pages in this default Web application: Default.aspx (Home), About.aspx,
and Contact.aspx. Each of these pages can be reached from the top navigation bar. There are
also two additional pages contained in the Account folder, the Register.aspx page and
Login.aspx page. These two pages allow you to use the membership capabilities of ASP.NET to
create, store, and validate user credentials.
When an ASP.NET Web Forms page runs, the page goes through a life cycle in which it performs
a series of processing steps. These steps include initialization, instantiating controls, restoring
and maintaining state, running event handler code, and rendering. As you become more familiar
with the power of ASP.NET Web Forms, it is important for you to understand the ASP.NET page
life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend.
When a Web server receives a request for a page, it finds the page, processes it, sends it to the
browser, and then discards all page information. If the user requests the same page again, the
server repeats the entire sequence, reprocessing the page from scratch. Put another way, a
server has no memory of pages that it has processed—pages are stateless. The ASP.NET page
framework automatically handles the task of maintaining the state of your page and its controls,
and it provides you with explicit ways to maintain the state of application-specific information.
Membership
ASP.NET Identity stores your users’ credentials in a database created by the application. When
your users log in, the application validates their credentials by reading the database. Your
project's Account folder contains the files that implement the various parts of membership:
registering, logging in, changing a password, and authorizing access. Additionally, ASP.NET Web
Forms supports OAuth and OpenID. These authentication enhancements allow users to log into
your site using existing credentials, from such accounts as Facebook, Twitter, Windows Live, and
Google.
By default, the template creates a membership database using a default database name on an
instance of SQL Server Express LocalDB, the development database server that comes with
Visual Studio Express 2013 for Web.
Master Pages
An ASP.NET master page defines a consistent appearance and behavior for all of the pages in
your application. The layout of the master page merges with the content from an individual
content page to produce the final page that the user sees. In the Wingtip Toys application, you
modify the Site.master master page so that all the pages in the Wingtip Toys website share the
same distinctive logo and navigation bar.
HTML5
The ASP.NET Web Forms Application template supports HTML5, which is the latest version of
the HTML markup language. HTML5 supports new elements and functionality that make it easier
to create Web sites.
Modernizr
For browsers that do not support HTML5, you can use Modernizr. Modernizr is an open-source
JavaScript library that can detect whether a browser supports HTML5 features, and enable them
if it does not. In the ASP.NET Web Forms Application template, Modernizr is installed as a NuGet
package.
Bootstrap
The Visual Studio 2013 project templates use Bootstrap, a layout and theming framework
created by Twitter. Bootstrap uses CSS3 to provide responsive design, which means layouts can
dynamically adapt to different browser window sizes. You can also use Bootstrap's theming
feature to easily effect a change in the application's look and feel. By default, the ASP.NET Web
Application template in Visual Studio 2013 includes Bootstrap as a NuGet package.
NuGet Packages
The ASP.NET Web Forms Application template includes a set of NuGet packages. These
packages provide componentized functionality in the form of open source libraries and tools.
There is a wide variety of packages to help you create and test your applications. Visual Studio
makes it easy to add, remove, and update NuGet packages. Developers can create and add
packages to NuGet as well.
When you install a package, NuGet copies files to your solution and automatically makes
whatever changes are needed, such as adding references and changing you’re the configuration
associated with your Web application. If you decide to remove the library, NuGet removes files
and reverses whatever changes it made in your project so that no clutter is left. NuGet is
available from the Tools menu in Visual Studio.
jQuery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event
handling, animating, and Ajax interactions for rapid web development. The jQuery JavaScript
library is included in the ASP.NET Web Forms Application template as a NuGet package.
Unobtrusive Validation
Built-in validator controls have been configured to use unobtrusive JavaScript for client-side
validation logic. This significantly reduces the amount of JavaScript rendered inline in the page
markup and reduces the overall page size. Unobtrusive validation is added globally to the
ASP.NET Web Forms Application template based on the setting in the <appSettings> element of
the Web.config file at the root of the application.
For more information about Visual Studio, see Visual Guide to Visual Web Developer.
Summary
In this tutorial you have created, reviewed and run the default Web Forms application. You have
reviewed the different features of the default Web forms application and learned some basics
about how to use the Visual Studio environment. In the following tutorials you'll create the data
access layer.
Additional Resources
Choosing the Right Programming Model
Web Application Projects versus Web Site Projects
ASP.NET Web Forms Pages Overview