in

ASP.NET Weblogs

Tolga Koseoglu

Complete hide textbox without loosing functionality

<asp:TextBox ID="txtHiddenTeamBalances" runat="server" Width="0px" BackColor="Transparent" ForeColor="White" BorderStyle="None" ReadOnly="true"></asp:TextBox>

Published Jun 30 2008, 12:49 PM by kemaltolga
Filed under:

Comments

 

dukebaby said:

When is this useful?

June 30, 2008 12:57 PM
 

markvt said:

It's not hidden it's still on the page and someone could select it when clicking init.

Why not use a session variable?

June 30, 2008 2:30 PM
 

Mark Hildreth said:

Alternatively, you can just add the attribute Visible="false". That has has the added benfit that if would prevent someone from just viewing the page source and discovering the textbox value.

June 30, 2008 4:16 PM
 

Jason Clark said:

Actually, instead of Visible="False" (which doesn't render the control in the DOM), you could just do style="display:none;" which hides the control on the page, but still renders it on the DOM, and allows you to do anything with it you desire.

It also reduces the amount of code you have to write to do the exact same thing.

July 2, 2008 9:18 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About kemaltolga

Born in Ankara, Turkey. Raised in Germany. Recruited for the Track & Field Team at Texas A&M University in College Station, TX, in January 2000. NCAA champion in 2001 (Discus). Work for design firm in southern California. Married with two daughters.