Solved

ASP.Net VB: View HiddenField value

Posted on 2007-11-27
2
1,349 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
[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
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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.…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 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