Skip to content


#1 Create your first Web Application

Post #1 in the series of 70-528 examples to help you study for the certification.

Skills covered in this post

Create and configure a Web application.

  1. Create a new Web application.
  2. Add Web Forms pages to a Web application.

Creating your first web application is pretty straighforward and a few ways to do it are covered here.

The example will be sprinkled with a lot of screenshots, and for a lot of you it will be too simplistic. I will just make this first post this detailed since a lot of the explanations does not matter for most of you.

Create a new Web application:

After opening up Visual Studio (I use VS2005), select “File” > “New” > “Web Site”.

Create New Web in Visual Studio 2005

Create a new web project in Visual Studio

Now you will see the screens below, and you will have to make a few decisions. Don’t worry, they are not hard.

There are 4 website types to be made in Visual Studio, even though it only looks like 3.

File based:

choose web site type

Choose web site type

All files are in a folder on the harddrive. This is the most used web site type. When the website is file based it is not needed to have IIS installed on the developer machine since the website can be run using the build-in webserver that Visual Studio has. This is the easiest way in my opinion to make a quick web site and test it.

Local HTTP:

Create local http based web site type

Create local http based web site type

The website is located on the local IIS. It can be run as the default web site or as a virtual directory running as an application.

Remote HTTP:

Create remote http based web site type

Create remote http based web site type

The website is located on a remote web server, and Front Page Server Extension is needed on the host.

FTP:

Create ftp based web site type

Create ftp based web site type

This is mostly very similar to Remote HTTP, but here the FTP protocol is used to transfer the web pages to the server instead of Front Page Server Extensions. When using FPT based site, you need to enter the FTP account username and password on the screen after clicking “OK”.


Choose .NET language

Choose .NET language

Language needs to be chosen as well. In my installation it can be either J#, VB.NET or C# by default, but a lot more languages can be enabled.

Tip: The language is not global in the sense that when you choose language here all pages needs to be that language. Each web page can be any language you wish, which enables collaboration even if the developers do not use same language. Remember .NET is not compiled, it is interpreted which is why the .NET framework is needed to execute .NET. This means it does not matter at all if the pages are not coded using the same language.

When in doubt when creating a web site, just use the file based type.

After clicking the “OK” button, the website project will apear in Visual Studio.

Visual Studio with newly created website

Visual Studio with newly created website

The text you see on the screen at this time is the code view and this is where you can enter “raw” html markup and you can even write .NET code here. If you write code in this place it will be called “inline code” since it’s mixed in with the markup.

You can swich to design view by clicking the design button.

This view is empty since theres no text or elements to show tough. For now we will stay in code view.

Inside the div tag we can write anything we want. We will ofcourse start with “Hello World”.

Hello World

Hello World

Now it’s time to give the new webpage a spin. Hit “F5″ or click the “play” button.

Start debugging runs webpage

Start debugging

Since “F5″ starts the website in debugging mode and the web.config file is not modified for that, the following screen will appear. Just click “OK”.

Enable debugging mode in web.config

Enable debugging mode in web.config

Feast your eyes on your first web page build in Visual Studio and .NET!

Hello World

Hello World

Add Web Forms pages to a Web application:

Time to add another web form to the web application.

In the solution explorer right click the web project and choose “Add New Item”.

Hello ASP.NET

Hello ASP.NET

On the popup make sure “Web Form” is chosen (this is a web page), and name the new page. This name can be changed later on if you want.

Choose type and filename

Choose type and filename

You can right click the new web page and choose to make it the page to start at when you run the project or you can browse the page directly.

View in browser

View in browser

Congratulation you have now completed the first babysteps on your way to learning ASP.NET.

DeliciousDiggTwitterFacebookLinkedInTechNetStumbleUponNewsVineTechnorati FavoritesSlashdotMSDNShare

No related posts.

Posted in 70-528 examples.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



Page optimized by WP Minify WordPress Plugin