MusicLovingIndianGirl MusicLovingIndianGirl - 6 months ago 34
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?


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

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