Asp. NET of projects and solutions

Source: Internet
Author: User

    •   Solution Solutions

A typical. NET Web application consists of many items, including content files (for example,. aspx files), source files (such as. cs files), assemblies (such as. exe and. dll files), and assembly information files, data source files (such as. mdb files), references, Icons and other files and folders. VS organizes these items into a folder that represents a Web site. All the files that make up the web are included in the solution. When you create a new Web site, vs will automatically create the solution and display it in Solution Explorer.

Typically, a solution includes one or more projects and/or sites, and may also include some standalone items. These stand-alone solution items, such as business case introductions, specification documents, and task plans. is not specific to a project but belongs to the entire solution. These solution items are not an essential part of the application because they do not affect the compilation output after they are removed. They are displayed in the Solution Items folder in Solution Explorer and can be managed using source code control.

Miscellaneous files are independent of solutions or projects, and they make development work more convenient. They are not involved in build and compilation, but are only displayed in Solution Explorer or can be edited. A typical miscellaneous file contains project notes, database structures, or simple code files. To display miscellaneous files as part of a solution, select Tools, Options, Environment, Document, check the check for Show Miscellaneous files in solution Explorer ".

The solution can contain no projects, but only solutions or miscellaneous files.

The solution is defined by the solution, which is created by VS, and the extension. sul. sul file contains a list of projects that comprise the solution, the location of the item at the solution level, and the build location at the solution level.

The following code is VS2013. sln.

You can open a resolution Fangan by double-clicking the. sln file. You can open a project file in vs even if you meiyou.sln the file. When you save, a new. sln file is created automatically.

    •   Projects and documents

A project contains content files, source code files, and other types of files. For example, data sources and pictures. Typically, project content is compiled into an assembly, such as an executable file (. exe) or a dynamic-link library (. dll) file.

The content of most Web pages or user controls consists of server control declarations and HTML. These elements, together with some necessary directives and scripts, make up the content files of the page and user control. The content file for the Web page is extended with an. aspx extension, and the user control has an. ascx extension. The Web service file has an. asmx extension, and the master page is in. Master.

Asp. NET supports code-behind. The source code on the server side is in a hidden file that is detached from the content file. Typically, the extension of a code-behind file indicates the programming language used by the file, such as. cs.

View the first line of the. aspx file:

<%@ Page Language="C #"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_default" %>

Where CodeFile specifies the code-behind file for the content file binding, inherits specifies the class to execute.

Code-behind is an encoding model of VS. When creating a new site, vs automatically creates two files: a content file named after the default name, such as Default.aspx, and a code-behind file that matches the file name, such as DEFAUL.ASPX.CX (if you use the C # language), if you modify the name of the content file, The code-behind file is automatically modified to the new name.

    •   Create a project with VS

Create a Web application not by creating a new project, but by building a new Web site.

To create a new project, you need to select a project type and template. There are many templates for each project type. You can also create an empty solution, ready to add any required items.

Templates determine which projects are automatically created and included in the project, as well as the default project settings. For example, if your project is a C # class library, you will create a language-specific. cs file.

Asp. NET of projects and solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.