Rquest request [""]; request. Form [""]; request. querystring [""]

Source: Internet
Author: User

<1>

Htmlpage.htm page [Request Page]

<HTML xmlns = "http://www.w3.org/1999/xhtml"> 


General handler. ashx page [processing Page]

<% @ Webhandler Language = "C #" class = "handler" %> using system; using system. web; public class handler: ihttphandler {// request. form can obtain the data submitted in post mode, requst. querystring can get the data submitted by the get method, while request can get the data transmitted by both methods at the same time; // speed: request. qeurystring is slightly faster than request. form // according to the transmitted data volume: request. form can transmit unlimited data, request. querystring can only pass 2 K of data. // For ease of installation: the request itself is direct and can be obtained no matter how the data is transmitted. The performance is slightly reduced, public void processrequest (httpcontext context) {context. response. contenttype = "text/html"; // --------------------------------------------------------- request. querystring [""] ------------ // when the method attribute of the <form> form on the htmlpage.htm page is set to get. request. querystring ["username"] takes effect only when the value string username1 = context is obtained. request. querystring ["username"]; // --------------------------------------------------------- request. form [""] ----------------- // request. form is the object that receives the POST method // request when the method attribute of the <form> form on the htmlpage.htm page is set to post. form ["username"] takes effect only when the value string username2 = context is obtained. request. form ["username"]; // configure request [""] ------------------------ // set the method attribute of the <form> form on the htmlpage.htm page to post, get, and context. request ["username"] can obtain the value string username3 = context. request ["username"]; // ------------------------------------ request. requesttype ----- obtain the HTTP transmission method ----------- // obtain or set the HTTP data transmission method (get or post) string requesttype = context. request. requesttype; context. response. write (username1); context. response. write (username2); context. response. write (username3);} public bool isreusable {get {return false ;}}}


Zookeeper

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.