Asp. NET State Management III (hidden domain HiddenField)

Source: Internet
Author: User
Tags http post

asp.net allows you to store information in a HiddenField control, which renders as a standard HTML hidden field.

Hidden fields are not rendered visible in the browser, but you can set their properties just as you would a standard control.

When a page is submitted to the server, the contents of the hidden field are sent along with the values of the other controls in the HTTP forms collection.

A hidden field can be used as a repository for any page-specific information you want to store directly in a page.

Security attention

Malicious users can easily view and modify the contents of a hidden field. Do not store any sensitive information in the hidden domain or protect the information that your application is running correctly.

The HiddenField control stores only one variable in its Value property and must be added explicitly to the page.

In order to be able to use the values of hidden fields during page processing, the corresponding page must be submitted using the HTTP POST command. If you use a hidden field, the hidden fields will not be available if the page is processed in response to a link or an HTTP get command.

The HiddenField control is used to store a value that should be persisted during each send to the server. It is rendered as a <input type= "hidden"/> element.

Typically, the state of a Web forms page is maintained by view state, session state, and cookies. However, if these methods are disabled or unavailable, you can use the HiddenField control to store the state values.

To specify the value of the HiddenField control, use the Value property.

When the value of the HiddenField control changes, the ValueChanged event is raised during each send to the server

 

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.