Build Your Own ASP.NET 3.5 Website Using C# & VB (7 page)

Read Build Your Own ASP.NET 3.5 Website Using C# & VB Online

Authors: Cristian Darie,Zak Ruvalcaba,Wyatt Barnett

Tags: #C♯ (Computer program language), #Active server pages, #Programming Languages, #C#, #Web Page Design, #Computers, #Web site development, #internet programming, #General, #C? (Computer program language), #Internet, #Visual BASIC, #Microsoft Visual BASIC, #Application Development, #Microsoft .NET Framework

BOOK: Build Your Own ASP.NET 3.5 Website Using C# & VB
2.97Mb size Format: txt, pdf, ePub

each of which has its own strengths and weaknesses. Yet ASP.NET has a few unique

features:

■ ASP.NET lets you write the server-side code using your favorite programming

language—or at least one the one you prefer from the long list of supported languages. The .NET Framework currently supports over 40 languages, and many of these may be used to build ASP.NET web sites. The most popular choices are

C# (pronounced “C sharp”) and Visual Basic (or VB), which are the ones we’ll

cover in this book.

■ ASP.NET pages are
compiled
, not interpreted. In ASP.NET’s predecessor, ASP,

pages were interpreted: every time a user requested a page, the server would

read the page’s code into memory, figure out how to execute the code, and execute

it. In ASP.NET, the server need only figure out how to execute the code once.

The code is compiled into efficient binary files, which can be run very quickly,

again and again, without the overhead involved in rereading the page each time.

This allows a big jump in performance, compared to the old days of ASP.

■ ASP.NET has full access to the functionality of the .NET Framework. Support

for XML, web services, database interaction, email, regular expressions, and

many other technologies are built right into .NET, which saves you from having

to reinvent the wheel.

■ ASP.NET allows you to separate the server-side code in your pages from the

HTML layout. When you’re working with a team composed of programmers and

design specialists, this separation is a great help, as it lets programmers modify

the server-side code without stepping on the designers’ carefully crafted

HTML—and vice versa.

Licensed to [email protected]

Introducing ASP.NET and the .NET Platform

5

■ ASP.NET makes it easy to reuse common User Interface elements in many web

forms, as it allows us to save those components as independent web user controls.

During the course of this book, you’ll learn how to add powerful features to your

web site, and to reuse them in many places with a minimum of effort.

■ You can get excellent tools that assist in developing ASP.NET web applications.

Visual Web Developer 2008 is a free, powerful visual editor that includes features

such as code autocompletion, code formatting, database integration functionality,

a visual HTML editor, debugging, and more. In the course of this book, you’ll

learn how to use this tool to build the examples we discuss.

■ The .NET Framework was first available only to the Microsoft Windows platform,

but thanks to projects such as Mono,1
it’s since been ported to other operating systems.

Still with us? Great! It’s time to gather our tools and start building!

Installing the Required Software

If you’re going to learn ASP.NET, you first need to make sure you have all the necessary software components installed and working on your system. Let’s take care of this before we move on.

Visual Web Developer 2008 Express Edition

Visual Web Developer 2008 is a free, powerful web development environment

for ASP.NET 3.5. It includes features such as a powerful code, HTML and CSS

editor, project debugging, IntelliSense (Microsoft’s code autocompletion technology), database integration with the ability to design databases and data structures visually, and much more. You’re in for a lot of Visual Web Developer

fun during the course of this book.

.NET Framework 3.5 and the .NET Framework Software Development Kit (SDK)

As we’ve already discussed, the .NET Framework drives ASP.NET. You’re likely

to have the .NET Framework already, as installs automatically through the

Windows Update service. Otherwise, it’ll be installed together with Visual Web

Developer.

1 http://www.mono-project.com/

Licensed to [email protected]

6

Build Your Own ASP.NET 3.5 Web Site Using C# & VB

Microsoft SQL Server 2005 Express Edition

This is the free, but still fully functional, version of SQL Server 2005. This

software is a Relational Database Management System whose purpose is to store,

manage, and retrieve data as quickly and reliably as possible. You’ll learn how

to use SQL Server to store and manipulate the data for the DorkNozzle application you’ll build in this book.
SQL Server Management Studio Express

Because the Express Edition of SQL Server doesn’t ship with any visual management tools, you can use this free tool, also developed by Microsoft, to access your SQL Server 2005 database.

Installing Visual Web Developer 2008 Express Edition

Install Visual Web Developer 2008 Express Edition by following these simple steps:

1. Browse to http://www.microsoft.com/express/vwd/.

2. Click the
Download Now!
link.

3. Under the
Web Install
section, click the
Download
link for Visual Web Developer 2008 Express Edition.

4. Execute the downloaded file,
vnssetup.exe
.

5. After you accept the terms and conditions, you’re offered two additional optional

products: MSDN Express Library, which contains the product and framework

documentation, and SQL Server 2005 Express Edition. Make sure to tick
both

options. This is very important, as we’ll be needing the SQL Server Express Edition database server to complete projects later in the book. Click
Next
. Licensed to [email protected]

Introducing ASP.NET and the .NET Platform

7

Figure 1.2. Installing Visual Web Developer 2008 Express Edition

6. In the next setup screen you’ll be informed of the products and components

you’re about to install. Click
Next
, and wait for the installer to download and

install the software. You can see what the setup window looks like in
Figure 1.2.

7. Start Visual Web Developer to ensure it has installed correctly for you. Its welcome

screen should look like Figure 1.3
.

Licensed to [email protected]

8

Build Your Own ASP.NET 3.5 Web Site Using C# & VB

Figure 1.3. The Start Page of Visual Web Developer 2008 Express Edition

Installing SQL Server Management Studio Express

You’ve just installed Visual Web Developer and SQL Server 2005 Express Editions.

You won’t use SQL Server until later in the book when we discuss relational databases, but we’ll install all the required software here so that when the time comes you’ll have the complete environment properly set up.

In order to use your SQL Server 2005 instance effectively, you’ll need an administration tool to work with your databases. SQL Server Management Studio Express is a free tool provided by Microsoft that allows you to manage your instance of SQL

Server 2005. To install it, follow these steps:

1. Navigate to http://www.microsoft.com/express/sql/download/ and click the

Download
link under the
SQL Server Management Studio Express
section.

Licensed to [email protected]

Introducing ASP.NET and the .NET Platform

9

2. Download the file. After the download completes, execute the file and follow the

steps to install the product.

Once it’s installed, SQL Server Manager Express can be accessed from
Start > All

Programs > Microsoft SQL Server 2005 > SQL Server Management Studio Express
. When executed, it will first ask for your credentials, as
Figure 1.4 illustrates.

Figure 1.4. Connecting to SQL Server

By default, when installed, SQL Server 2005 Express Edition will only accept connections that use Windows Authentication, which means that you’ll use your Windows user account to log into the SQL Server. Since you’re the user that installed

SQL Server 2005, you’ll already have full privileges to the SQL Server. Click
Connect

to connect to your SQL Server 2005 instance.

After you’re authenticated, you’
ll be shown the interface in Figure 1.5, which offers

you many ways to interact with, and manage, your SQL Server 2005 instance.

SQL Server Management Studio lets you browse through the objects that reside on

your SQL Server, and even modify their settings. For example, you can change the

security settings of your server by right-clicking
COMPUTER
\SQLEXPRESS
(where
COMPUTER
is the name of your computer), choosing
Properties
, and selecting
Security

from the panel, as shown in Figure 1.6
. Here we’ve modified the
Server authentication
mode to SQL Server and Windows Authentication mode. We’ll need this setting

a bit later in the book, but you can set it now if you want, and then click
OK
.

Licensed to [email protected]

10

Build Your Own ASP.NET 3.5 Web Site Using C# & VB

Other books

Ghettoside by Jill Leovy
Taking Care of Moses by Barbara O'Connor
Todd, Charles by A Matter of Justice
Dark Haven by Gail Z. Martin
Selling Out by Amber Lin
Held by Bettes, Kimberly A
I Came to Find a Girl by Jaq Hazell