Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all!

I'm newbie in ASP .Net and I get the "TypeError: Sys.WebForms is undefined - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End);" error when I run site in webhost (in localhost I haven't this problem).

Thank you!
Fabio - Brazil


In formPri.aspx:

...
<ajaxToolkit:ToolkitScriptManager ID="TSMFormPri" runat="server"
EnablePartialRendering="False" AsyncPostBackTimeout="0">
<Scripts>
<asp:ScriptReference Path="/sgf/js/inicializa.js" />
</Scripts>

...

In inicializa.js

jQuery(document).ready(function() {
Sys.Application.add_init(AppInit);
function AppInit(sender) {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End); <---- ERROR IS HERE
}
function End(sender, args) { }
});
Posted

check the link :
http://forums.asp.net/t/1333182.aspx[^]


tips:
abandon ajaxToolkit:ToolkitScriptManager
and adopt jquery !
 
Share this answer
 
Comments
Sistema SGT 25-Jul-13 21:55pm    
Have you someone example about jQuery x ajaxToolkit:ToolkitScriptManager?
Thanks!
Chui PuiKwan 25-Jul-13 22:05pm    
jquery ajax or .net ajaxToolkit?
Sistema SGT 25-Jul-13 22:10pm    
How can I abandon ajaxToolkit:ToolkitScriptManager and adopt jquery?
That you want to use ajaxToolkit indicate that you want to implement you functions by ajax and asynchronous .

Now,the ajaxToolkit is outdated .

You can implement your all functions by jquery ajax and jquery plugins .

click below link:

http://plugins.jquery.com/[^]

http://api.jquery.com/jQuery.ajax/[^]
 
Share this answer
 
Comments
Sistema SGT 25-Jul-13 23:29pm    
Could be change:

<ajaxToolkit:ToolkitScriptManager ID="TSMFormPri" runat="server"
EnablePartialRendering="False" AsyncPostBackTimeout="0">
<Scripts>
<asp:ScriptReference Path="/sgf/js/inicializa.js" />
</Scripts>

by:

$.ajax({
type: "GET",
url: "/sgf/js/inicializa.js",
dataType: "script"
});

Sorry! I didn't know of this alternative.
Chui PuiKwan 26-Jul-13 1:47am    
$.ajax({
type: "GET",
url: "yourpage.aspx?id=1",
dataType: "script"
});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900