Solved

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

Posted on 2006-06-19
6
821 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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