server control that will render <input type="hidden"`

N

neverstill

hi-

I need to have an asp:TextBox that will allow me to set the type attribute
to hidden. I can't seem to find a way to do this. Basically, I have a
Wizard application that will show/hide different panels for each step. I
need to track what step I'm on, so I though I would just add a simple little
hidden input and increment it each time. Not so easy.

the Visible property of the basic asp:TextBox sets whether or not the
control is rendered. I don't want that. I just want type="hidden"

Am I going to need to make my own server control?

Any tips? I feel that I MUST be missing something....

Thanks,
Steve
 
K

Ken McAndrew

Try using a label instead of a textbox. If you set the label's Visible
status to False, it'll act just like a hidden form field, with the added
benefit that your users won't see it if they look in the source code. Then
you can call that field with the label's Text property, change it, use it
wherever needed.

Hope that helps.
 
C

Christophe Gijbels

just add the runat="server" to a normal hidden field

<input type="hidden" runat="server" id="myHiddenField" />

The type of your control is HtmlInputHidden
 
N

neverstill

thanks guys, rad solutions the both of them. i like the label one cause
it's clean.

Anyway, thanks again!
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top