Hidden Texbox

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.
 
R

Raterus

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

Page.RegisterHiddenField("somename", "somevalue")
 
R

Rob T

Thanks. Works great!

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

Page.RegisterHiddenField("somename", "somevalue")
 
B

bruce barker

<input type=hidden id=hiddenField runat=server>

or create the control in the codebehind (see htmlcontrols)

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top