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.
- Create a new Web application.
- 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”.
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:
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:
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:
The website is located on a remote web server, and Front Page Server Extension is needed on the host.
FTP:
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”.
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.
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”.
Now it’s time to give the new webpage a spin. Hit “F5″ or click the “play” button.
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”.
Feast your eyes on your first web page build in Visual Studio and .NET!
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”.
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.
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.
Congratulation you have now completed the first babysteps on your way to learning ASP.NET.
No related posts.















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