Solved

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

Posted on 2006-06-19
6
790 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now