In this post i am going to Explain how to use ASPXHiddenField , and how to get HiddenField values using Javascript.
1.First we need to drag and drop ASPxHiddenField in source code. like that
1.First we need to drag and drop ASPxHiddenField in source code. like that
<div> <dx:ASPxHiddenField ID="ASPxHiddenField" ClientInstanceName="cliHidden" runat="server"></dx:ASPxHiddenField>
</div>
2. After that assign value to ASPXHiddenField control which values you want to assign.
in .CS code
ASPxHiddenField["cliHidden"] = txtEmployeeID.tex;
3.in Javascript we need to write this code..
<script type="text/javascript">
function RedirectToEntryScreen() {
var sFilter = cliHidden.Get('cliHidden');//here we get hiddinfile values
if (sFilter != "0=1")
location.href = '/Modules/HRM/ATD/ATD_ShiftAssignmentsEntry.aspx';
else if (sFilter == "0=1") {
alert("Employee does not exist for the user");
hide();
}
}
function hide()
{ setInterval(function () { ParentLoadingPnl.Hide(); }, 1); }
</script>
Note: if it will not work for you then you need to add this JQuery Library (jquery-1.7.1.min) .