Asp.net.4 Advanced Program 4th edition 3rd Chapter Web Form

Source: Internet
Author: User

3.1 Page Processing

1. TheWeb application is executed on the server . The browser sends the customer's information to the server. Asp. NET receives this page, it triggers the appropriate server-side event to notify your program code.

2.The Web application is stateless . View state records the state of the customer segment.

3.1.1

HTML form, an HTML page with two text. Fistname=value,lastname=value will be submitted at the time of submission.

String fistname=request.form["Fistname" in ASP

String Fistname=txtfirstname.text can be used in ASP.

NOTE: ASP. NET contains only one <form>,<form> requires runat= "Server" feature

3.1.2 Dynamic User Interface

String message = "<span style\=" color:red\ ">"; Response.Write (message); You can simply set the attribute lblweblcome.forcolor=color.red;

3.1.3 ASP. NET event model

1. Run for the first time. Asp. NET to create page and control objects, initialize the code. Displays HTML to the client. Remove from memory.

2. The user triggers the event, all the form submissions on the page, and the page is reconstructed according to the view.

3.asp.net the status of the last commit according to the submission.

4. Triggering the corresponding event

5. The modified HTML is sent to the client, and the page is removed from memory.

There are new events to repeat 2,4 steps

3.1.4 Auto Loopback

The AutoPostBack property of the Web control is set to true. Asp. NET will automatically generate a JavaScript event.

3.1.5 View state

The Web control EnableViewState property False does not enable view state.

First time request

View state is at risk of being modified, and do not use information from view state as the basis.

2. View state chunking

<configuration>

<system.web>

<pages maxpagestatefieldlength= "1024x768" >

<system.web>

</configuration>

3.1.6 XHMTL Compatibility

1. Label and attribute names must be in lowercase

2. All elements must be closed

3. All elements must be closed

1. Document type definition

The page directive is the document type definition

<! DOCTYPE HTML PUBLIC "-//w3c//dtd XHTML 1.1//en" "Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >

2. Configuring XHTML Rendering

<configuration>

<system.web>

<pages controlrenderingcompatibilityversion= "4.0" >

</system.web>

</configuration>

3.1.7 Client ID

ClientIDMode 4 enumeration values autoid link the container and the control ID to produce an ID

The ID of the Static service segment is the ID of the customer segment

Predictable and autoid the same connection, but a little more concise

Inherit use the same policy as the parent container, or read the policy for the configuration file

3.2 Web Forms processing phase

Asp.net.4 Advanced Program 4th edition 3rd Chapter Web Form

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.