How to access the value of a hidden field in code behind using c#
Posted on 2016-09-13
The following two hidden fields are in the asp.net side of the code,
<asp:HiddenField ID="HiddenField2" runat="server" />
<asp:HiddenField ID="HiddenField1" runat="server" />
I need to be able to access the value of the Hidden field and assign to a variable, in asp.net code behind using c#. The values are coming back null.
string UserNameValue3 = HiddenField2.Value;
string UserNameValue4 = HiddenField1.Value.ToString();