I have 3 pics above. I don't know how to declare variable in JavaScript to get value from ascx and code behind.
Using the code as below to get the hidden value using jQuery code.
var libraryName = $("input[id$='hdnLibraryName']").val();
Example:
.ascx code
<input type="hidden" id="hdnLibraryName" runat="server"/>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var libraryName = $("input[id$='hdnLibraryName']").val();
console.log(libraryName);
});
</script>
.ascx.cs code
protected void Page_Load(object sender, EventArgs e)
{
this.hdnLibraryName.Value = "Library1126";
}