Creating your first ASP.Net WebForms application in Visual Studio may seem like a daunting task to someone who is both unfamiliar with Visual Studio and unfamiliar with ASP.Net. With this tutorial I hope to show you just how easy it can be to get a basic website up and going and maybe take some of the fear of the unknown out of the process.
First, if you don't have Visual Studio, you can download Web Developer Express as well as SQL Server 2008 Express Edition. Both of these tools are available for free from the Microsoft Express Web page. So if you need to go ahead and install these tools and then come back and continue the tutorial.
Alright, now that you have the tools installed lets get started. To create a new web application in Visual Studio, click on file from the menu selection, then select new and then Project (File->New->Project). This will open a New Project Dialogue where you will have a couple of options on types of projects to create. We're going to select ASP.Net Web Application.
This will create a new project with a couple of pages already created for you, a Master Page and two content pages, the Default page and the About page. The master page creates the basic template for the look of the site. The content pages add the actual content for the website.
You're layout could be slightly different from mine, but should contain most of the same elements as in the image. From this point you can either make changes to the generated web pages or delete them and create new ones. You should have a section named "Toolbox" as seen on the left side of the image above. Adding controls such as text boxes and drop downs to your page is as simple as dragging a control from the toolbox onto the webpage. The web page can be edited in either Source view or Design view. I prefer to stay in Source view for the most part myself but you can play with it yourself and see which mode you prefer.
Now to run your page using Visual Studio's built in web server you can either hold the Control key and press F5 or select Debug from the menu and then select "Start Without Debugging". Visual Studio should then automatically open your default web browser pointed to the local address of the web page.
And that's it, your first ASP.Net web page is done. For further tutorials be sure to check out the ASP.Net tutorials here on Dream.In.Code and you can also check out the official ASP.Net tutorials as well.
- Caffeine Lounge
- Corner Cubicle
- Student Campus
- Software Development
- Industry News
- Introduce Yourself
- C and C++
- .NET Framework
- Other Languages
- Game Development
- Mobile Development
- 52 Weeks Of Code
- Web Development
- HTML & CSS
- Graphic Design
- Flash & ActionScript
- SEO & Advertising
- Web Servers & Hosting
- Site Check
Follow & Share
Give It A Try!
- ASP.NET - enabling plugins using UserControls
- Persisting dynamically loaded data across postbacks
- ASP.NET C# How to Generate A Random Password And Email It To Someone
- Potentially dangerous Request.Form value was detected from the client
- Creating a strongly typed templated control
- Implementing the MVP pattern in ASP.NET
- ASP.NET C# Mobile Browser Detection for HTML5 Video
- MVC 3 WebGrid inside a WebGrid
- Book Review: Murach's ASP.NET 4 Web Programming with VB2010
- Razor helpers
- 52 More ASP.NET Tutorials...
- Use WMI to retrieve CPU ID in VBScript
- ASP Calendar Month view
- Asp Calendar
- Downloading (pushing) large files
- Accessing web.config connection strings with VB
- Check for valid HttpRequest
- Get Script File Name
- Some "missing" logic functions
- 10 More ASP.NET Snippets...