Hidden fields are html input controls with type as hidden type store hidden data in the html. Hidden fields are not displayed on the web browser, but if you view source, you can see both the hidden field and it’s value. Not very secure. They do allow you to post information to other pages, or back to the same page.so you can’t srore sensitive data in hidden fields.
System.Web.UI.WebControls.HiddenField and System.Web.UI.HtmlControls.HtmlInputHidden are two types on hidden control available in asp.net
Use Hidden Field when need to post small amout of data post back to it self.
Hidden Fields advantages :
- Almost all browsers support hidden fields.
- Using hiddenfield data is stored on html page,so no server resources are required, if it is of type html input type.
Hidden Fields having some drawbacks also :
- Using large no of hidden field will increase the HTML page size, so loading of page becoming slower.
- As we can able to view HTML page source, we can abel to see hidden field value so no securtiy.
- we can only able to save single value in hidden field , not able to save structured data like dataset etc.