I tried your suggestion, but the script still doesn't seem to be working correctly. I underlined the changes I made to the script:
function PrimeKeyCheck(sender, args)
{
var numberOfRecords=0;
var hiddenField = document.getElementById("<%=NumOfRecordsHiddenField.ClientID%>").value;
numberOfRecords = parseInt(hiddenField.value);
alert(numberOfRecords.value);
if (numberOfRecords > 0)
{
args.IsValid = false;
return;
}
args.IsValid = true;
return;
return ;
}
I think it located the hidden field but is as if the control has no value or there is something wrong with the value. Also, thanks for the help so far. Any more suggestions on what could be wrong?