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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Narasappa jadiyannavarPosted Mar 26, 2012, 4:22 AM
www.w3schools.com/aspnet/control_htmlinputhidden.asp
Jignesh TrivediPosted Mar 26, 2012, 4:20 AM
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.
SenthilkumarPosted Mar 26, 2012, 4:19 AM
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