Wednesday, December 28, 2016

Creating a New ASP.NET Website

 Creating a New ASP.NET Website in asp.net is pretty challenging but I will show you how to create it step by step.
1. Start by creating a folder called BegASPNET in the root of your C drive using File Explorer (Windows Explorer on older versions of Windows). Inside the folder, create another folder called Site. You should end up with a folder called C:\BegASPNET\Site. If you followed the instructions from the “Introduction” section of this book and unpacked the source for this book, you already have the BegASPNET folder, which in turn contains the Source and Resources folders.You still need to create the Site folder, though. If you want to follow along with VB.NET and C# at the same time, you can create two folders, BegASPNETVB and BegASPNETCS, and use two instances of Visual Studio.
2. Start Visual Studio and choose File ➪ New Web Site or File ➪ New ➪ Web Site, depending on your vers ion of VS.common mistakes :
common mistakes Don’t mistakenly create a new Web Application Project using File ➪ New Project because this project template is not compatible with the exercises in this articles.
3. In the target framework drop-down list at the top of the screen, select .NET Framework 4.5.1.
4. In the Installed Templates area on the left, choose between Visual Basic and Visual C#. All the examples in this article are shown in both programming languages, so you can choose the one you like best.
5. In the area in the middle select ASP.NET Empty Web Site.
6. In the Web Location drop-down list, make sure that File System is selected. The other two options (HTTP and FTP) enable you to open a site running on IIS (either on your local machine or on a remote server using the so-called Microsoft FrontPage Server Extensions) and open a site from an FTP server, respectively.
7. Click the Browse button next to the location text box, browse to C:\BegASPNET\Site (the folder you created in the first step of this exercise), and click Open. Your final screen should look like the one in Figure 2-2, except that you may have chosen Visual C# instead of Visual Basic.
8. Click OK and VS creates the new site for you.



How It Works
As soon as you click OK, VS creates a new, empty website for you. This new website contains nothing but two configuration files (called Web.config and



Web.Debug.config). In the Solution Explorer, your website now looks like Figure 2-3 (note that I expanded the Web.config file). If you don’t see the top-level Solution node, choose Tools ➪ Options in VS, and in the Projects and Solutions category select Always Show Solution. Because a website based on the Empty Web Site template is just a simple Windows folder that VS looks at, the actual folder on disk contains the same files. No additional files are used to create the site, as shown in Figure 2-4, which shows File Explorer displaying the files in the folder C:\BegASPNET\Site.

-----------------------------------------------------------------------------------------




If you don’t see the .config extension of the web file, don’t worry. You see how to view file extensions in a later exercise. As you progress through this book, you’ll add new files and folders to the site. These additional files and folders show up in the Solution Explorer and will appear in the Windows folder at C:\ BegASPNET\Site as well. Opening websites based on the Web Site Project template is very similar to creating new ones. In the next section, you get a quick overview of opening existing sites in VS.



Next:Opening Existing Websites in vs 2013

No comments:

Post a Comment

We are happy for leaving comments,we will don't let you bite stay with us

Popular Posts

Contact Form

Name

Email *

Message *