In this article I am going to show how to start with creating an asp.net website using Visual Web Developer 2008.
Introduction
This article is meant for a beginners/freshers who want to learn how to create an ASP.NET website. In this article, I am going to show how to create an asp.net website using Visual Web Developer 2008 in few steps.
Step - 1
Download Visual Web Developer from asp.net website (use this url http://asp.net/downloads/essential/) and install it. This is free of cost available and you can use it without any hassle of buying a license.
Step - 2
Open Visual Web Developer from your Start menu by clicking on its "Microsoft Visual Web Developer 2008 Express Edition". It will take few seconds to open.
Step - 3
Go to File Menu and Click on New Web Site ... as displayed in the picture below.
Step - 4
A Dialogue box will appear asking for Template, Location, Language. Select/write the location in the location TextBox, Select ASP.NET Web Site as Tempate and Select Visual C# as language as displayed in the picture below. Click OK.
Step - 5
This will create a default.aspx, default.aspx.cs (it is called as codebehind file) file, web.cofig file and an App_Data (It is used to place your database like MS Access or SQL Express or xml files ) folder by default as displayed in the picture below.
Step - 6
Start writing few codes as displayed in the picture below. You can notice that as soon as you started writing code, Visual Web Develope will give intellisense (dropdown) to complete the code of the control as shown in the picture below.
Write a Label control and a Button control as displayed in the picture below. You can notice that in the OnClick property of the Button control I have specified the name of the method that will fire when the button will be clicked. I will write this method in the Codebehind file.
Step - 7
Now press F7 key from the Keyboard and you will jump to the Codebehind file named default.aspx.cs. Alternatively you can click + symbol beside the default.aspx file and double click default.aspx.cs. Write few lines of code into it as displayed in the picture below. In this file Page_Load method will be automatically written. I am writing SubmitMe method that will fire when Button will be clicked as stated above. Now Save all files by clicking on the Save All toolbar or by going through File->Save All.
Step - 8
Now hit F5 key from your keyboard and your application will start in the debug mode. Alternatively you can click on the Play button from the toolbar. This will ask you to modify the web.cofig file to start the application in the debug mode like picture below. Click OK button.
Step - 9
After few seconds a browser will open with your default.aspx page like below picture.
Step - 10
Try clicking the Submit button and you will see that a message "Hello World" appears in the browser just beside the Button like below picture.
Thats it!!!
Conclusion
You are done with creating a website in ASP.NET. Now you can add new page by going through File>New File... or right clicking (at the root folder) the right hand side Solution explorer window.
Thanks