Join David Gassner for an in-depth discussion in this video Hello World: Creating your first ASP.NET web site, part of ASP.NET Essential Training.
- View Offline
Once you've installed Visual Web Developer and the ASP.NET framework, you're ready to create your first ASP.NET website. Start by going to the Windows Start menu, go to All Programs, and from there, locate the menu choice for Microsoft Visual Web Developer 2008 Express Edition and start the application. When Visual Web developer first opens, it displays a start page. The start page shows a list of recent projects that you might have worked on. I created one project previously called Begin. And if you selected the option to allow an RSS feed to be retrieved by Visual Web Developer during the installation process, you'll see the RSS feed on the right. To create a new website, select File > New Website or press the keyboard shortcut Shift+Alt+N, for new. On the New Web Site screen, select ASP.NET website. Set the Location to File System, and then select the location of your first website. This is going to be a brand-new website, so it can go anywhere on disk. I'm going to place it under the Chapter 01 Getting Started folder under my Exercises folder.
I'll click the Design button to see what the application approximately looks like when it's shown in the browser. Now, I will type in the words Hello World. I'll save my changes by pressing Ctrl+S or going to the menu and selecting Save Default.ASPX. Notice at the bottom of the screen the structure of the web page is displayed showing that there's an HTML tag, a body tag, within that a paragraph tag, and within that a span tag. You can switch back and forth between Design and Source view as you need. Notice that when I typed in the words Hello World, that those words were wrapped inside this span tag. Now, to test the page in the browser, I'll go to the Menu and select Debug. Notice that there are two options: Start Debugging and Start Without Debugging. In order to use the page with debugging, there are some configuration changes you need to make at this point. So for simplicity, I'll choose the menu choice Start Without Debugging, which you can also go to with the keyboard shortcut Ctrl+F5. The page opens in the browser, displaying the text that I typed in. Now, I'm going to right-click anywhere on the page and select View Source in Internet Explorer and show you the result. As shown in Visual Web Developer's Source view, the text Hello World is wrapped inside a span tag set. You'll also notice, if you look at the source, that there's a generated input object with the type of hidden, and a name of __VIEW STATE. I described the use of this view state object in other videos, but if you've gotten this far, then you've successfully created your first website, your first ASP.NET page, and you've successfully tested it in Internet Explorer.
- Storing data with SQL Server
- Using the GridView control to present and edit dynamic data
- Creating a data entry system
- Attaching external CSS files
- Creating pages to log in and authenticate visitors
- Installing Internet Information Services (IIS) on Windows XP and Windows Vista
- Deploying an ASP.NET website on IIS