GidgetGeorgiannAdolfo
New Member
I want to use a hidden field on my webform that I can access from the webform's class. If I use:<BR><BR><input type="hidden" runat="server"><BR><BR>I can not access this from the webform's class. Like wise the asp:textbox control does not seem to have this 'hidden' functionality. If I set the asp:textbox visible=false the control does not render as html and thus I can not access it. Presently I have a asp:textbox with a width="1" to work aorund this problem, but doesn't any Server Control render to:<BR><BR><input type="hidden" runat="server"><BR><BR>???<BR><BR>Thanks for any help!<BR><BR>- rpetersYou can use the ViewState to persist data from one page to another. See the bottom part of this article:<BR>http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx<BR><BR>The above article is the best way to do this, although a hack way is the way you have listed or to use a label control (<asp:label ... />) without having it's Text property set (therefore the HTML created will be <span id="idname"></span>)<BR><BR>hthI am actually going to need to reference the value of the hidden input field from a javascript, which is why I can't use the viewstate (as far as I know). I am rather surprised (or will be until proven wrong) that ASP.NET does not provide a Server Control that renders to a <input> of type hidden.<BR><BR>rpeters