473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Hidden Texbox

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.
Nov 18 '05 #1
5 1466
Do you know about this method? Hidden fields are the way to go.

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

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message news:Ob**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 18 '05 #2
You can try:
TextBox.Visible = false

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 18 '05 #3
Thanks. Works great!

"Raterus" <ra*****@spam.org> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
Do you know about this method? Hidden fields are the way to go.

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

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 18 '05 #4
Setting Visible=false removes the HTML from the form...I had to be a hidden
textbox.

"Sharon Tal" <ta*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You can try:
TextBox.Visible = false

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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.


Nov 18 '05 #5
<input type=hidden id=hiddenField runat=server>

or create the control in the codebehind (see htmlcontrols)

-- bruce (sqlwork.com)
"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1082
by: albertoalar | last post by:
I m trying to intercept a return in a texbox (Pocket pc ) when a barcode is writed. I need help thanks
9
1192
by: Marcel Saucier | last post by:
Hello, I want to create several texboxes on a form and I would like to refer to them (properties, etc) in a form of an array. Is that possible ? Example: Instead of...
0
1469
by: Yog | last post by:
Hi, How to access the value of a Texbox column(Template field) in gridview and to update a column next to it in the Gridview...! Example:Let's say there are four columns Product,Cost,Quantity...
1
2173
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and...
3
1106
by: tshad | last post by:
I have some textboxes that are being hidden using <div runat="server"which mean they are not on the page But I am also trying to set focus to a Textbox when it is on the screen. When the Textbox...
3
1262
by: menakavenkatesh | last post by:
i want simple coding for changing fontsize of the texbox
6
2045
by: dba | last post by:
using the following code with a problem.... echo "<input type='hidden' name='member_id' value=\"{$row}\">{$row}"; echo "<input type='radio' name='member_name' value=\"{$row}\">{$row}<br />"; ...
4
3001
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
8
15238
ddtpmyra
by: ddtpmyra | last post by:
This is just a follow-up question above, this time i wanted to have a dependend drop down that when the users selected 'others' for instance another texbox will show-up right next to my drop down. ...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.