Microsoft JScript runtime error: 'Sys' is undefined

Achilles picture Achilles · Dec 19, 2009 · Viewed 60k times · Source

I have a page with the following code on it:

<script type="text/javascript" language="javascript">
    /// <reference name="MicrosoftAjax.js" />

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

    function EndRequestHandler(sender, args)
    {
        ToggleTimeDiv();
    }
</script>

When the page loads I get the following error:

  • Microsoft JScript runtime error: 'Sys' is undefined

I'm using Visual Studio 2008 Standard Edition. What is causing this error?

Answer

ACP picture ACP · Dec 19, 2009

Is your <script> block ahead of your ScriptManager?