In this ASP.NET tutorial you will learn how to run an ASP.NET page using Visual Studio 2010. You should learn how to run an ASP.NET page before you learn any further details on ASP.NET 4 programming like adding controls to a page etc.
The first thing you need in order to run an ASP.NET page which is an .aspx file, is a Web Server. When you create a production website, you will always use Internet Information Services also known as IIS as your web server. But for just testing an ASP.NET page, you can use the ASP.NET Development Server. The ASP.NET Development Server runs on the Local machine and does not require the IIS web server.
- When you create file system web sites, the default Web Server in Visual Web Developer is the ASP.NET Development Server.
The following is a step by step ASP.NET tutorial on how to run an ASP.NET page (.aspx page) on your local PC.
- From the Solution Explorer, select the ASP.NET page (here it is Default.aspx).
- Right Click on Default.aspx ASP.NET page and Select the “Set As Start Page”.
- Go to the Standard Toolbar and then select the Run button (Start Debugging button).
- As this is the First time you are running your ASP.NET page, the Debugging is not Enabled. So on press of the Start Debugging button, a dialog box appears asking whether to Create a new Web.config file with debugging enabled or run without debugging.
- If you choose to Create a Web.config file for the first time, it will also ask you to Update the Web.config file when you run it for the second time.
- Running without Debugging is the same as pressing Ctrl + F5
- Visual Web Developer starts the ASP.NET Development Server. An icon appears on the toolbar to indicate that the Visual Web Developer Web server is running.
- The ASP.NET page will be displayed in the browser. Even thought the ASP.NET page you created has an extension of .aspx, it currently runs like any .HTML page.
- After you are done, you can close the Web browser.