Solved

How do I retrieve hidden form fields posted to another page?

Posted on 2006-06-19
6
811 Views
Last Modified: 2009-11-11
To create the hidden textboxes I've tried creating regular text boxes and making them hidden and by using RegisterHiddenField.

Then on the page I want to get the variables from, I've tried:

Request.Form["txtHiddenField"]
Request.Params["txtHiddenField"]
Request.Params.Get("txtHiddenField")

No combination returns the values.

Thanks
0
Comment
Question by:dtburdick
6 Comments
 

Expert Comment

by:eljefe
ID: 16934900
This is how I'm doing it, I have a hidden HTML textbox:

<input id="hdnListText" type="hidden" name="hdnListText">

In my code I simply request as follows:

If Request("hdnListText") <> "" Then

I've had no problems with it.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 16934983
There is a specific control for hidden fields:

    <asp:HiddenField ID="HiddenField1" runat="server" Value="wibble" />

You can then retrieve the value using the methods in your original post.
0
 

Author Comment

by:dtburdick
ID: 16935623
Neither of those worked.

The first one returns blank.  I'm using C# so maybe it is syntax thing.

The second shows on the GUI "Error Creating Control" and when I hover over it the following error shows:

Parser Error: Could not load type System.Web.UI.WebControls.HiddenField from assembly System.Web, Version=1.0.5.000.0, Culture=neutral, PublicKey Token=b03f5f7f11d50a3a.
0
 

Author Comment

by:dtburdick
ID: 16937279
I figured it out.

I was issuing the RegisterHiddenField method just prior to the Server.Transfer call so the controls are never actually posted.  I put them into the Page_Load() event and the posted through fine.
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 17160202
PAQed with points refunded (125)

DarthMod
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question