asp.net Web Forms from getting started to mastering detailed

Source: Internet
Author: User
Keywords asp.net

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Introduction to Web Forms: ASP.net is a new development model, combining the advantages of simple ASP development and VB efficiency. Developers can drag and drop controls onto a page, write code (in a code-behind page) to provide interactivity, invoke business objects, and perform other tasks.

Web Forms: Also includes directives, user controls, server controls, and server-side data binding syntax. Web forms are made up of HTML, code, and controls, where controls are executed on a Web server running Microsoft Internet Information Services (IIS). Web Forms display the user interface by generating HTML that is sent to the browser, while controls that support code and run the UI reside on the Web server. The separation of the client interface from the server-side code is a key differentiator between Web Forms and traditional Web pages. The traditional Web page needs to send all the code to the browser to process, while the Web form sends only the interface controls to the browser and leaves the page processing on the server side. The separation of the UI and code enhances the security and functionality of the Web page and extends the scope of the supported browsers.

Properties of Web Forms: the functionality of Web Forms is defined through level three attributes; Page properties define global functionality, Body properties define how pages are displayed, and form properties define how control groups are handled.

1. Page Properties

< @Page > tags define page-specific properties that are used by the ASP.net page parser and compiler. Each *.aspx file can contain only one < @Page > tag. For example:

<%@ page title= "Home page" language= "C #" masterpagefile= "~/site.master" autoeventwireup= "true"
Codefile= "Default.aspx.cs" inherits= "_default"%>

Where the Language property specifies the language to be used when compiling all inline code <%%> and <%=%> and code declaration blocks on the page, and the property value includes any. NET programming language, such as C#,visual basic.net,j#. Only one language can be used and specified on each page.

CodeFile property (. NET upfront version is the Codebehind property) specifies the path to a code-behind page file that refers to a page reference, which is used with the Inherits property to associate a code-behind page file with a Web page.

The AutoEventWireup property indicates whether the event of the page is automatically bound. True if automatic binding is started for events, or false, and the default value is true.

The Inherits property is used to define a code-behind class for page inheritance.

2. Body Properties

The <body> Tag property defines the appearance of objects that appear in the client browser, for example:

<body ms_positioning= "GridLayout" >

<body> tag properties are primarily pagelayout properties, marked as ms_positioning, and are used to determine the location of controls and text in a page, with two options: FlowLayout (text, image, control Wrap) and GridLayout.

3. Form Properties

The <form> Tag property defines how the control is handled, although there are many HTML forms on the page, but there can be only one server-side form on the *.aspx page. Typical <form> marks are:

<form id= "Form1" method= "POST" runat= "Server" >

</form>

</form> tag attributes include the following two types

The 1.method property defines how the control is returned to the server. Post and get.

A key feature of the 2.WEB form is that the control runs on the server side. runat= the "Server" property causes the form to send control information back to the ASP.net page on the server side that supports code running. If the Runat property is not set to server, the form can only be run as a generic HTML form.

How Web Forms work:

In ASP.net Web Forms, the code-behind mechanism is used, separating the code and background logic code associated with the actual appearance into two different files has the main advantage of effectively increasing the security and functionality of the Web page, expanding the scope of the supported browsers, and facilitating the division of Labor, thereby improving development efficiency.

When you use code-behind pages, each *.aspx page is associated with a code-behind page, and the code-behind page must be compiled before the information returns to the requesting client browser. Each Web Forms page consists of two separate files (*.aspx pages and *.aspx.cs) that will form a unit when the ASP.net application runs. www.0372hr.cn www.hqqrc.com

The steps to perform the Web Forms compilation are as follows:

(1). The link file *.aspx page must be associated with the code-behind page *.aspx.cs page, and the page directive is automatically added to the Visual Studio platform to implement this association.

Article. JIT just-in-time compilation: code-behind pages are compiled when the client first requests a *.aspx page. After the first request, all subsequent requests use an existing compiled file. Therefore, the time to process the first page request will be longer, and the subsequent requests will be more quickly.

(3) Execution: When a user requests a *.aspx page, the dynamic link library file processes the incoming request and creates the appropriate HTML and script to return to the requesting browser to respond.

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.