I have an ascx user control and want to store the value of a TextBox on the usercontrol to a hidden item on the user control. I then want to reference the hidden control in the C# code behind to do some validation.
I have this hidden item
<input type="Hidden" id="Hidden1" value="" clientidnode="Static" runat="server">
I want to set the value of this hidden item after the page loads and am trying to use this J Query script
$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
var v1 = $("#<%=TxtCaseNumber.ClientID%>")
$('#Hidden1').val(v1);
});
I then use the C# code behind to check the value of the Hidden1 item using
string s = Hidden1.Value;
No value is being assigned? What am I missing here?