Showing posts with label Creating a New ASP.NET 4.5.1 Website. Show all posts
Showing posts with label Creating a New ASP.NET 4.5.1 Website. Show all posts

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

Tuesday, December 27, 2016

Choosing between Web Site Projects and Web Application Projects

Choosing between Web Site Projects and Web Application Projects

          Because you have two options to choose from, you may be wondering which project type you should pick. In general, the Web Site Project is a bit easier to work with. Because it’s just a folder, it’s easier to copy the files to a different location, such as another development workstation or a production server. Also, changes to the code files are picked up by the web server and applied automatically without a formal deployment process. The Web Application Project, on the other hand, works better if you work with a team of developers on the same site, because it dictates a more formal development and deployment process and has better support for working with Source Control versioning systems, such as Microsoft’s Team Foundation Server. In addition, it supports other technologies such as ASP.NET MVC and Web API.
This book uses the Web Site Project model because it’s easier to work with if you’re new to ASP.NET. However, you’ll find that sites built using the Web Application Project model have a lot in common with Web Site Projects, which means you can use the knowledge you gain from this book to build sites with the Web Application Project model as well. You must use the Web Site Project
model if you want to follow along with this book. When not referring to a specific project type, I’ll use the terms website and web application interchangeably throughout this book when referring to websites in general. Now that you know about the different project models, the next thing to consider is the different website templates and their options. Choosing the Right Website Template The New Web Site dialog box in VS contains different website templates, each one serving a distinct purpose.
              Figure 2-1 shows the New Web Site dialog box in VS. You can open this dialog box by choosing File ➪ New Web Site or File ➪ New ➪ Web Site, depending on your version of VS. If your dialog box doesn’t look like Figure 2-1, make sure you chose File ➪ New Web Site and not File ➪ New Project. In the left-hand section you can choose between Visual Basic and Visual C# as the programming language for your site. The section in the middle shows the ASP.NET website templates that are installed by default. Each of them is discussed in the next section. When you have created your own templates or have templates installed from other parties, they show up in this area as well.


         Above the list of templates, you can select the .NET Framework version you want to use. For all exercises in this article, make sure you always choose .NET Framework 4.5.1. The ASP.NET Empty Web Site template is used throughout this articles for the Planet Wrox website. The others are described briefly in the following sections so you know how they can be used. The exact list of installed templates on your system depends on the version of Visual Studio and the installed components. Don’t worry if you have other templates as long as you have the ASP.NET Web Forms Site and the ASP.NET Empty Web Site items.


ASP.NET Web Forms Site in VS 2013

Sunday, December 25, 2016

ASP.NET 4.5.1 server

An Introduction to ASP .NET 4.5.1 server

asp.net

 ASP .NET 4.5.1 server is describe here When you type a URL like www.wrox.com in your web browser and press Enter, the browser sends a request to the web server at that address. This is done through HTTP, the HyperText Transfer Protocol. HTTP is the protocol by which web browsers and web servers communicate. When you request the URL, you send a request to the server. When the server is active and the request is valid, the server accepts the request, processes it, and then sends the response back to the client browser. The relationship between the request and response is shown in Figure 1-8Because you are using IIS Express, the server and the client are really the same machine. However, in a real-world scenario, you’ll host your website on an external web server where it can be accessed by many different clients.For simple, static files, like HTML files or images, the web server 
server to system
reads the file from its local hard drive and sends it to the browser. However, for dynamic files, such as ASPX pages, this is obviously not good enough. If the web server were to send the ASPX file directly to the browser as a text file, you wouldn’t have seen the current date and time in the browser, but instead you would have seen the actual code (<%: DateTime .Now.ToString() %>). So, instead of sending the file directly, the web server hands over the request to another piece of software that is able to process the page. This is done with a concept called Application Mapping or Handler Mapping, where an extension of a file (.aspx in this example) is mapped to an application that is capable of handling it. In the case of an .aspx page, the request is eventually handled and processed by the ASP.NET run time, part of the Microsoft .NET Framework designed specifically to handle web requests.

During the processing of the page, three main areas can influence the way the page eventually ends up in the browser:
➤➤ Static text. Any static text, like HTML, CSS, or JavaScript code you place in a page, is sent to the browser directly. You learn more about HTML, CSS, and JavaScript (a programming language used at the client) in this and subsequent chapters, including Chapter 3, which gives you a detailed look at CSS.
➤➤ ASP.NET Server Controls. These controls are placed in your ASPX page and when they are processed, they emit HTML that is inserted in the page.
➤➤ Programming code. You can embed code, like Visual Basic .NET or C#, directly in a page, as you saw in the previous Try It Out. In addition, you can place code in a separate code file. The official term for this code file is Code Beside. However, most developers refer to this as the Code Behind file, which is the term I’ll stick to in this book. This code can be executed by the run time automatically, or based on a user’s action. Either way, execution of the code can greatly influence the way the page is displayed, by accessing databases, performing calculations, hiding or showing specific controls, and much more. You learn more about this Code Behind file in the next chapter, and programming, Once the page is done processing, and all the HTML for the page has been collected, the HTML is sent back to the browser. The browser then reads it, parses it, and, finally, displays the page for you to look at. Because HTML is so critical for displaying web pages, the next section gives you an overview of HTML.

Popular Posts

Contact Form

Name

Email *

Message *