Solved

ASP.Net VB: View HiddenField value

Posted on 2007-11-27
2
1,345 Views
Last Modified: 2010-05-18
I would like to view the value of a hidden field to make sure it is getting a value.  This is the code I have in the code-behind page:

hdnPaidThruDateA.Value = CDate(result).ToString("MM/yyyy")

This is the code in the .aspx page:

<asp:HiddenField ID="hdnPaidThruDateA" Value="hdnPaidThruDateA" Visible="true" runat="server" />  

I have Visible="true" which I am assuming that if the value is in the .aspx hidden value field, I should be able to see it.  When the page is rendered I don't see the value.  If I'm doing this incorrectly how can I see the value?

Thanks.

John
0
Comment
Question by:jcpatterson
2 Comments
 
LVL 3

Accepted Solution

by:
bcaff86 earned 125 total points
ID: 20361544
I believe setting visible="true" on a hidden field is a waste of time as it will always be hidden.

When I've run into this in the past I've used a text field and just set the style="display:none;".

Works the same as a hidden field but it will be rendered in your markup everytime.
0
 
LVL 8

Expert Comment

by:arhame
ID: 20362116
Easiest way to see values you're trying to set, I've found, is to just use response.write()  So in the codebehind, after you do:
hdnPaidThruDateA.Value = CDate(result).ToString("MM/yyyy")

To see the value it assigned, just:

Response.Write(hdnPaidThruDateA).Value

After you've seen that it's getting the proper value, just delete the response.write.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 30
asp.net web application 3 27
Add a Condition in ASP Repeater 6 34
How to repeat the data 4 16
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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