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

Forms and hidden fields

Hi,

Are hidden fields passed in the querystring when a form is posted back?
If they are, must the hidden fields be server controls in order to
access them from .net code?

Thanks,
Roshawn
Nov 19 '05 #1
5 2126
No, they are passed in a form post which is different from a query string
(but has a similar effect)

AFAIK you can access them directly as Request["myHiddenField"] or
Request.Form["myHiddenField"]

but if you want to access them as server controls you can do that as well,
just declare them in the usual way:

<input type="hidden" runat="server" id="myHiddenField" name="myHiddenField"
value="xyz">

I always make the ID and Name the same in this case - it's not strictly
necessary but a lot less confusing.

"Roshawn Dawson" <ud****@bellsouth.net> wrote in message
news:uZ*************@TK2MSFTNGP15.phx.gbl...
Hi,

Are hidden fields passed in the querystring when a form is posted back? If
they are, must the hidden fields be server controls in order to access
them from .net code?

Thanks,
Roshawn

Nov 19 '05 #2
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted back?
If they are, must the hidden fields be server controls in order to
access them from .net code?

Thanks,
Roshawn


no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #3
Thanks guys for your prompt responses.

It seems that one of you says that hidden fields are not passed in the
querystring while the other says the opposite. Perhaps I wasn't clear
enough.

What I mean by hidden fields is hidden form fields. You know, the input
fields whose type is specified as hidden, like this:

<input type="hidden" name="227" id="227" value="stuff that is hidden" />

Are such fields included in the querystring or not?

Thanks,
Roshawn

Curt_C [MVP] wrote:
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted
back? If they are, must the hidden fields be server controls in order
to access them from .net code?

Thanks,
Roshawn

no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

Nov 19 '05 #4
Hi,

If you are using method="post" in your form element, the hidden fields will
be sent in the Request Collection when you submit the form.

If you are using the method="get", it will be sent in the query string

--
Saravanan K V
"Roshawn Dawson" wrote:
Thanks guys for your prompt responses.

It seems that one of you says that hidden fields are not passed in the
querystring while the other says the opposite. Perhaps I wasn't clear
enough.

What I mean by hidden fields is hidden form fields. You know, the input
fields whose type is specified as hidden, like this:

<input type="hidden" name="227" id="227" value="stuff that is hidden" />

Are such fields included in the querystring or not?

Thanks,
Roshawn

Curt_C [MVP] wrote:
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted
back? If they are, must the hidden fields be server controls in order
to access them from .net code?

Thanks,
Roshawn

no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

Nov 19 '05 #5
Thank you. Now I understand. :-)

Roshawn

Saravanan K V wrote:
Hi,

If you are using method="post" in your form element, the hidden fields will
be sent in the Request Collection when you submit the form.

If you are using the method="get", it will be sent in the query string

Nov 19 '05 #6

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

Similar topics

1
by: petersk | last post by:
Firstly I am an older person trying to teach myself to create a project and teach myself Access VBA programming along the way. I anticipate a number of problems I will need help with but here...
6
by: Manny Chohan | last post by:
I am using forms authetication in the web config. i can validate a user against a database and click on images which makes hidden panels visible.However when i click on the link inside a panel...
1
by: foothills bhc | last post by:
I have a problem with verifying content of controls on a form before closing the form or moving to the next form "record" (i.e., when moving to the next row of my form's record source). HERE'S THE...
3
by: Jerim79 | last post by:
I was handed a voting form that the company has used in previous years, for updating. The first page is a form, asking for name, business name, title and email address(twice for verification). The...
7
by: thersitz | last post by:
I can't seem to get my html form to submit properly from within a web form. Here's my form tag syntax and some delivery hidden fields. <form id="myForm"...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
2
by: vajra1987 | last post by:
Hi guys I have the following situation: In mypage1.jsp I have 4 forms, each with a different name (and id). But on these forms, there are some fields that have the same name, for example ...
4
by: minchazo | last post by:
Hello, I've been creating some forms recently in Access 2003 and using hidden textboxes quite a bit. As an example, the visible textbox CasesDone uses the DLookup function to sum the records in...
6
by: Graham | last post by:
I have long thought there is something missing with HTML forms, in that there should be a provision for a form with hidden input fields, with the whole form being hidden, in particular with no...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.