Solved

ASP.Net VB: View HiddenField value

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 37
asp.net mvc5 3 38
Paging GridView 7 34
ASP.net VB.net Email  a webpage 3 26
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

19 Experts available now in Live!

Get 1:1 Help Now