473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

"Hidden" Web Server Control

I'm a middle tier (dll / MTS / COM+ / Extensions) guy and I'm a bit rusty on
the GUI part of ASP.NET

I have a web form that a user uses to cycle through records in the DB to
review unmatched items and assign / fix them.

I need the WebForm to contain the identity key from the SQL Server table so
the Save button can pass it in a WHERE clause so that the system updates the
correct record, but I don't want the user to SEE this value on the WebForm.

I have tried various combinations of Label / TextBox, Visible=False, and so
forth, and I can't see how to make .NET deliver a <input type=hidden...> to
the browser.

I would REALLY rather not put a Hidden HTML control on the form and have to
do filthy scripting hacks to get the Page_Load to be able to stuff the
primary key of the current record into an HTML control that the server code
can't see.

I also would rather not have to use TextBox Server Controls and then set a
whole bunch of CSS attributes so that border, backcolor and forecolor are
all the same as the background. That's just a dirty kludge to me.
--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Dec 12 '05 #1
3 1812
Page.ClientScript.RegisterHiddenField for ASP.NET 2.0
Page.RegisterHiddenField for ASP.NET 1.1

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm a middle tier (dll / MTS / COM+ / Extensions) guy and I'm a bit
rusty on the GUI part of ASP.NET

I have a web form that a user uses to cycle through records in the DB
to review unmatched items and assign / fix them.

I need the WebForm to contain the identity key from the SQL Server
table so the Save button can pass it in a WHERE clause so that the
system updates the correct record, but I don't want the user to SEE
this value on the WebForm.

I have tried various combinations of Label / TextBox, Visible=False,
and so forth, and I can't see how to make .NET deliver a <input
type=hidden...> to the browser.

I would REALLY rather not put a Hidden HTML control on the form and
have to do filthy scripting hacks to get the Page_Load to be able to
stuff the primary key of the current record into an HTML control that
the server code can't see.

I also would rather not have to use TextBox Server Controls and then
set a whole bunch of CSS attributes so that border, backcolor and
forecolor are all the same as the background. That's just a dirty
kludge to me.

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane

Dec 12 '05 #2
> Page.ClientScript.RegisterHiddenField for ASP.NET 2.0
Page.RegisterHiddenField for ASP.NET 1.1


Perfect! Thanks!

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Dec 12 '05 #3
if you dont wish to use the primary key on the client side

then you can store it in the viewstate of the

like in c#
ViewState["Pkey"]=1;

and retrieve it on postback by

(int)ViewState["Pkey"](if it is a int)

this ensures that your primary key is encrypted and is not visible for
scripting purpose

"Mike Labosh" wrote:
I'm a middle tier (dll / MTS / COM+ / Extensions) guy and I'm a bit rusty on
the GUI part of ASP.NET

I have a web form that a user uses to cycle through records in the DB to
review unmatched items and assign / fix them.

I need the WebForm to contain the identity key from the SQL Server table so
the Save button can pass it in a WHERE clause so that the system updates the
correct record, but I don't want the user to SEE this value on the WebForm.

I have tried various combinations of Label / TextBox, Visible=False, and so
forth, and I can't see how to make .NET deliver a <input type=hidden...> to
the browser.

I would REALLY rather not put a Hidden HTML control on the form and have to
do filthy scripting hacks to get the Page_Load to be able to stuff the
primary key of the current record into an HTML control that the server code
can't see.

I also would rather not have to use TextBox Server Controls and then set a
whole bunch of CSS attributes so that border, backcolor and forecolor are
all the same as the background. That's just a dirty kludge to me.
--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane

Dec 12 '05 #4

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

Similar topics

6
by: Saqib Ali | last post by:
I have created a slider using Javascript and html tables that generally works very well. As you move the "knob" to the right, a numeric value in an adjactent <INPUT type="text"> tag increases....
3
by: neverstill | last post by:
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...
2
by: alex | last post by:
I need to set a directory with hidden and/or system attribute from my c# code. Similar to what is c:\RECYCLER folder set to in WinXP. So it is not visible to a user with default "Folder Options". ...
2
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my...
7
by: parag1234567 | last post by:
Hi, I am dynamically generating a html file which will contain only <div> tags which contents are hidden from user( set by style="visibility:hidden") Now the next step is i am enabling some of...
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
3
by: dba | last post by:
Without giving a lot of script at this time, I am having a problem with php and form input type="hidden". Problem is that the hidden variable displays last line from database query. Some code....
1
by: Patient Guy | last post by:
I have a "hidden" anchor in the body of a doc. By "hidden," I mean that the contained text of the anchor is indistinguishable from the surrounding text, the text contained by its parent/ancestor...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.