How to use Hidden Control? pls send with Examples.
Thanks&Regs
Magesh.A
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Mar 26, 2012, 12:19 AM EDT
The HiddenField control provides you with a way to store information in the page without displaying it. For example, you might store a user-preference setting in a HiddenField control. To put information into a HiddenField control, you set itsValue property to the value you want to store between postbacks.
As with any other Web server control, the information in a HiddenField control is available during postback. The information is not persisted outside the page.
The ASP.Net Hiddenfield will be created like this.
Tht HTML hidden field will be defined like this.
If you want to assign the value from the server side then
hidName.Value = "Testing";
For more information you can visit this web portal:
http://msdn.microsoft.com/en-us/library/ms227988(v=vs.85).aspx
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 26, 2012, 12:20 AM EDT
ASP.NET allows you to store information in a HiddenField control, which renders as a standard HTML hidden field. A hidden field does not render visibly in the browser, but you can set its properties just as you can with a standard control. When a page is submitted to the server, the content of a hidden field is sent in the HTTP form collection along with the values of other controls.
To use
In ASpx File:
To set and retrive data
hdMyFiled.Value = "mystest";
var str = hdMyFiled.Value;
hope this help.
Narasappa jadiyannavar96 reputationPosted Mar 26, 2012, 12:22 AM EDT
www.w3schools.com/aspnet/control_htmlinputhidden.asp