General processing programs, ASP. NET core knowledge (5), asp.net Core

Source: Internet
Author: User

General processing programs, ASP. NET core knowledge (5), asp.net Core
First glance

1. Create a general processing program 

Create a general processing program

2. Check the code in it. 

Public class MyHandler: IHttpHandler

{

Public void ProcessRequest (HttpContext context)

{

Context. Response. ContentType = "text/plain ";

Context. Response. Write ("Hello World ");

}

Public bool IsReusable

{

Get

{

Return false;

}

}

}


Generally, our logic is mostly written in ProcessRequest.

Request Method (form)

1. Several attributes of form
<Form name = "input" action = "http://www.baidu.com" method = "get"> Username: <input type = "text" name = "user"> <input type = "submit" value = "Submit"> </form> 1) the browser submits data to the server, put the submitted data form (input, select, textarea, etc.) into form. form sets the page to which the form is submitted through the action attribute. In order to retrieve the value of the form item on the server, you need to set the name attribute for the form element in HTML. 2) Note that id is used for JavaScript operation Dom, and name is submitted to the server. Duplicate IDs and names are allowed. duplicate names are submitted to the server. 3) method is the submission method, which can be divided into get and post methods.

2. GET and POST

Html form <form> can automatically submit parameters to the server.

Get is submitted through url request parameters, and request parameters are directly exposed in the url.

Post is based on the reporting style, and the submitted data is not directly exposed to the user.

3. Which labels will be submitted?Which labels will be submitted to the server? To submit the content entered by the user to the server, the following conditions are met: Submission condition 1:It can only be input, textarea, or select tags. Submission condition 2:Only the values of the value Attribute of the three tags (select is the value of the selected item) will be submitted to the server. The name attribute must be set for the tag (truth: No name is used to spell the URL I = 5 ). To submit the value Attribute value of a tag to the server, you must set the name attribute for the tag, when submitted to the server, it will be submitted to the server in the form of "name = value" key-value pairs. Name is used for the server, and id is used for the Dom. Submission Condition 3:For RadioButton, the same name is a group, and the value of the selected RadioButton is submitted to the server. (Truth: if all are submitted, does the server know who is selected ?) Submission Condition 4:When input = submit, only the value of the clicked button (with name required) will be submitted (truth: otherwise, I know who has been clicked ?). Submission condition 5:Put it in the form label. Only labels placed in the form label can be submitted to the server, and other labels outside the form are ignored.

Related Article

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.