ASP. NET fetch HTML control value

Source: Internet
Author: User
Tags html form

ASP. NET fetch HTML control value
All the value controls inside the HTML form are key=value&key=value& with key values after they are submitted.
This form is submitted to the background.

Radio also, the selected radio value will be passed back to the background, the background with request["Radio name"] to take a value on the line. If the value description is selected.

Such as:
<input type= "Radio" value= "1" name= "Rdo1" checked= "checked"/>a
<input type= "Radio" value= "2" name= "Rdo1"/>b

Background can be value: request["Rdo1"]
Value is: 1

The difference between Request, Request.Form, and Request.QueryString
The request itself is a static object of the system and can itself be called as an array, such as
request ("ABC") is the value that corresponds to the key value "ABC" in the request array, which is not a fixed, but a collection of multiple arrays, which contains
(QueryString, Form, Cookie, clientcertificate,servervariables) These are the values of the array of server variables, that is, by request you can iterate through the arrays and return the corresponding values.  It is convenient to use, once and for all.
The member function of Request.Form this request is not so broad, just take the value from the form array, that is, the page form <form> label input unit (such as <input type=text > The value passed over.  It is not possible to get the arguments passed in the link string as index.asp?abc=123 in the form.
another way is to request.  QueryString ("abc") in this form, you can get the parameters passed by the QueryString link string.
these three methods can be distinguished by several mechanisms for transmitting data in HTTP.  Request.Form can get data submitted as a post, requst.querystring can get the data submitted in the Get method, while request can get the data passed by both methods.
in terms of the amount of data passed, Request.Form can pass an unlimited amount of data, while Request.QueryString can only deliver 2k of data.
by speed, request.qeurystring will be slightly faster than Request.Form.

Reference: http://wenku.baidu.com/link?url=-_JE03F398Nb-HjawMBSWDRL6bnZqqKv7E6CKA1YUo5D4fh4_ Fmvdn0b0eprokdcvihzofmzfbtjzusdsqvuqqt48ghjx716u8cqt-w2cr_

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.