I am attempting to register the following JavaScript code in order to add freeze functionality to a GridView. However, when trying to compile, I encounter the error message 'Microsoft JScript runtime error: 'Sys' is undefined'
How can this issue be resolved?
<script language="javascript" type="text/javascript">
// This script is used to maintain grid scroll during partial postback
var scrollTop;
// Register begin request and end request
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
// Get the div scroll position
function BeginRequestHandler(sender, args)
{
var m = document.getElementById('divGrid');
scrollTop=m.scrollTop;
}
// Set the div scroll position
function EndRequestHandler(sender, args)
{
var m = document.getElementById('divGrid');
m.scrollTop = scrollTop;
}
</script>