MusicLovingIndianGirl MusicLovingIndianGirl - 1 year ago 73
ASP.NET (C#) Question

Get Value of Hidden Field in Client Side

On a button click on my server side, I assign value to the Hidden Field from a column in my table.

Dim dsGetEnquiryDetails = dbl.usp_GetEnquiryRegisterDetails(Val(lblEnquiryRegisterID.Text)).AsQueryable
For Each record In dsGetEnquiryDetails
HiddenStatusFlag.Value = record.StatusFlag

In my client side function I use this, but not getting any value.

var StatusFlag = '';
StatusFlag = document.getElementById('<%= HiddenStatusFlag.ClientID%>');

What am I missing?

Answer Source

That returns the input. You need the value of the hidden input.

StatusFlag = document.getElementById('<%= HiddenStatusFlag.ClientID%>').value;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download