Hidden Texbox

  • Thread starter Thread starter Rob T
  • Start date Start date
R

Rob T

I have a user control that need to have a hidden textbox. (I have some JS
that needs to get some info out of it) If I make a standard textbox
(<asp:TextBox ID="txtTest" Runat="server" />) in my control it works
fine....of course it shows it on the screen

It seems so simple...but how the heck do you create a hidden textbox that is
a control?

BTW, I've done hidden textboxes in the past my just doing a
response.write("<input type=hidden ...>") before, but now since I will have
several of the same controls on the page, I need to keep track of the ID of
the box. I figured using a control is nice since it remembers the values it
has on a postback.......

Thanks.

-Rob T.
 
Do you know about this method? Hidden fields are the way to go.

Page.RegisterHiddenField("somename", "somevalue")
 
Thanks. Works great!

Do you know about this method? Hidden fields are the way to go.

Page.RegisterHiddenField("somename", "somevalue")
 
<input type=hidden id=hiddenField runat=server>

or create the control in the codebehind (see htmlcontrols)

-- bruce (sqlwork.com)
 
Back
Top