Thursday, October 7, 2010

ASP HiddenField control

This is a client side storage control. The word tells us this control is hiding on web-page right it hides from the world. So, typical hidden field control code looks like below.

<asp:HiddenField ID="HiddenField1" runat="server" />

There are several properties but I just cover two main properties
1) Value
2) Visible

Value: This property is used to assign or store some data in hiddenfield control as shown below.

<asp:HiddenField ID="HiddenField1" Value="Data to be Hidden from Web browser" runat="server" />

Try to work on this it wont display on your web browser.

Visible: This property is optional, but better to know what it does. You are hiding some important data or some confidential data in hidden field. You need to use visible property. why because when you run your program try this way.

Right click on your web browser and select view source. You can see the hidden field value on your source code page. So that reason I use visible property to hide it on view source page too.

<asp:HiddenField ID="HiddenField1" Visible="false" Value="Data to be Hidden from Web browser" runat="server" />

Thank you for reading
Emmaneale Mendu
Web Developer

No comments:

Post a Comment