473,395 Members | 1,456 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,395 software developers and data experts.

Is there a Server Side hidden input?

Dan
Is there a way to access and set a hidden input types in the code-behind
page for ASP.Net?

This seems like a common thing that would need to be done, I must be missing
something obvious.

Basically, I need to have some sort of server side hidden input type
component which I can set in the code behind page, and also be used in
javascript.

Thanks in advance,
Dan
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
Nov 18 '05 #1
6 1977
"Dan" <dh******@somewhere.com> wrote in
news:uO**************@TK2MSFTNGP12.phx.gbl:
Is there a way to access and set a hidden input types in the code-behind
page for ASP.Net?


You can edit the HTML directly to enter them. But you want to modify them
directly in server side code too?

Check the WebForm properties for options. That failing, a really simple
custom control that does this would only be a few lines if you dont need
design time support.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Nov 18 '05 #2
You could use a server label with its visibility set to false, which results
in an HTML <SPAN> tag with the visibility:false value for the style
attribute.

"Dan" <dh******@somewhere.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Is there a way to access and set a hidden input types in the code-behind
page for ASP.Net?

This seems like a common thing that would need to be done, I must be missing something obvious.

Basically, I need to have some sort of server side hidden input type
component which I can set in the code behind page, and also be used in
javascript.

Thanks in advance,
Dan
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004

Nov 18 '05 #3
Just use an html hidden input and add runat="server". If you are using VS,
you can right click on the control and check run as server control.

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Dan" <dh******@somewhere.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Is there a way to access and set a hidden input types in the code-behind
page for ASP.Net?

This seems like a common thing that would need to be done, I must be missing something obvious.

Basically, I need to have some sort of server side hidden input type
component which I can set in the code behind page, and also be used in
javascript.

Thanks in advance,
Dan
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004

Nov 18 '05 #4
Dan
Thanks for the response.

You mean there is no built-in hidden server control?

That seems like a pretty striking oversight. Suppose I have some value that
I want to use in a javascript calculation but doesn't need to be displayed,
so I want to put it in a hidden input field. How would I set this from the
code-behind page?

I guess I can generate the HTML for the <input> tag each time but then I
lose the state management that the other server-side components have.

Just seems like a simple thing Microsoft should have included. They have all
the other input types, why not have a hidden one?

Thanks,
Dan
"Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message
news:Xn*****************@127.0.0.1...
"Dan" <dh******@somewhere.com> wrote in
news:uO**************@TK2MSFTNGP12.phx.gbl:
Is there a way to access and set a hidden input types in the code-behind
page for ASP.Net?


You can edit the HTML directly to enter them. But you want to modify them
directly in server side code too?

Check the WebForm properties for options. That failing, a really simple
custom control that does this would only be a few lines if you dont need
design time support.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
Nov 18 '05 #5
I believe you can add the "runat=server" magic text on a hidden input
tag. At that point, you can code it like any other tag and have the
value available on server side. You would need to use the attributes
collection instead of a "text" property I think
On Mon, 16 Feb 2004 18:12:48 -0800, "Dan" <dh******@somewhere.com>
wrote:
Thanks for the response.

You mean there is no built-in hidden server control?

That seems like a pretty striking oversight. Suppose I have some value that
I want to use in a javascript calculation but doesn't need to be displayed,
so I want to put it in a hidden input field. How would I set this from the
code-behind page?

I guess I can generate the HTML for the <input> tag each time but then I
lose the state management that the other server-side components have.

Just seems like a simple thing Microsoft should have included. They have all
the other input types, why not have a hidden one?

Thanks,
Dan
"Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message
news:Xn*****************@127.0.0.1...
"Dan" <dh******@somewhere.com> wrote in
news:uO**************@TK2MSFTNGP12.phx.gbl:
> Is there a way to access and set a hidden input types in the code-behind
> page for ASP.Net?


You can edit the HTML directly to enter them. But you want to modify them
directly in server side code too?

Check the WebForm properties for options. That failing, a really simple
custom control that does this would only be a few lines if you dont need
design time support.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004


Nov 18 '05 #6
You would use its VALUE attribute as always.
"Dan Brussee" <db******@nc.rr.com> wrote in message
news:fg********************************@4ax.com...
I believe you can add the "runat=server" magic text on a hidden input
tag. At that point, you can code it like any other tag and have the
value available on server side. You would need to use the attributes
collection instead of a "text" property I think
On Mon, 16 Feb 2004 18:12:48 -0800, "Dan" <dh******@somewhere.com>
wrote:
Thanks for the response.

You mean there is no built-in hidden server control?

That seems like a pretty striking oversight. Suppose I have some value thatI want to use in a javascript calculation but doesn't need to be displayed,so I want to put it in a hidden input field. How would I set this from thecode-behind page?

I guess I can generate the HTML for the <input> tag each time but then I
lose the state management that the other server-side components have.

Just seems like a simple thing Microsoft should have included. They have allthe other input types, why not have a hidden one?

Thanks,
Dan
"Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message
news:Xn*****************@127.0.0.1...
"Dan" <dh******@somewhere.com> wrote in
news:uO**************@TK2MSFTNGP12.phx.gbl:
> Is there a way to access and set a hidden input types in the code-behind > page for ASP.Net?

You can edit the HTML directly to enter them. But you want to modify them directly in server side code too?

Check the WebForm properties for options. That failing, a really simple
custom control that does this would only be a few lines if you dont need design time support.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004

Nov 18 '05 #7

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

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
2
by: Francois | last post by:
Hi, I have a form which contains some non server side controls. I have seen in the generated HTML of a page that non server side controls can be read by the server code (C# or VB.NET) as the...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
2
by: ayende | last post by:
I've a very strange issue here. I've this JS code: var hidden = document.createElement('input') //hidden.type='hidden'; hidden.value = getIdForUser(userTag)...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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
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...

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.