After going through following articles, you might be interested in Start learning ASP.NET Control

How to create an ASP.NET website using Visual Web Developer? (Pictorial View)

SheoNarayan
Posted by in ASP.NET category on for Beginner level | Views : 186350 red flag
Rating: 4.38 out of 5  
 8 vote(s)

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
Page copy protected against web site content infringement by Copyscape

About the Author

SheoNarayan
Full Name: Sheo Narayan
Member Level: HonoraryPlatinum
Member Status: Administrator
Member Since: 7/8/2008 6:32:14 PM
Country: India
Regards, Sheo Narayan http://www.dotnetfunda.com

Ex-Microsoft MVP, Author, Writer, Mentor & architecting applications since year 2001. Connect me on http://www.facebook.com/sheo.narayan | https://twitter.com/sheonarayan | http://www.linkedin.com/in/sheonarayan

Login to vote for this post.

Comments or Responses

Posted by: Ranjan on: 10/11/2011 | Points: 25
thanku sir..but in step 6 i think no need of typin there..in d design part v can drag n drop buttons or labels os anyother tool..rite..??
Posted by: Ranjan on: 10/11/2011 | Points: 25
n may i know wat is tat number after http://localhost ...????

Login to post response

Comment using Facebook(Author doesn't get notification)