views:

101

answers:

3

I have referenced this existing query here regarding jQuery $(document).ready? and UpdatePanels

I am getting a Javascript error on line...

var prm = Sys.WebForms.PageRequestManager.getInstance();

The error is :

Microsoft JScript runtime error: 'Sys' is undefined

Any resolution for this? What could I be missing?

A: 

Make sure the ASP.NET ScriptManager control is above your Javascript. It could very easily be that you're calling Sys.WebForms.PageRequestManager before it's been loaded.

Paperjam
+1  A: 

Taking this a step further from what Paperjam wrote.

var prm;

$(document).ready(function(){
    prm = Sys.WebForms.PageRequestManager.getInstance();
});

That will avoid trying to reference Sys before it exists. If that doesn't work it could be something else entirely.

hunter
You'll probably need to do something like this also, to prevent $ clash between ASP.NET Ajax and jQeuryvar $j = jQuery.noConflict();
epitka
A: 

Make sure your page contains the following:

<asp:scriptmanager runat="server" />
Naeem Sarfraz