Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, October 25, 2006 1:01 PM
I'm using ASP.NET AJAX 1.0. And I wrote javascript like below:
<script type="text/javascript" language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)
function BeginRequestHandler(sender, args)
{
}
function EndRequestHandler(sender, args)
{
}
</script>
When running, I was told "Sys.WebForms.PageRequestManager is null or not an object". Why? What was I missing?
All replies (11)
Wednesday, October 25, 2006 4:17 PM
Your code is probably executing too early. Place it at the bottom of the <form> tag to make sure it runs only after Atlas has been loaded.
Thanks,
Eilon
Wednesday, October 25, 2006 5:30 PM
Thank you, Eilon.
I put the script in UpdatePanel and then it works.
Actually, It will be fine to put it after
<asp:ScriptManager ID="scriptManager1" EnablePartialRendering="true" runat="server"></asp:ScriptManager>.
Tuesday, May 1, 2007 5:09 AM
This approach worked for me. Thanks.
Thursday, May 10, 2007 8:06 PM
This works but only when it's on IIS 6, i'm using windows xp and locally it doesn't work, it does if i run it in the visual studio web server though, what's going on?
Monday, April 28, 2008 1:41 PM
This might be late in responding, but I had the same issue. In our case, I could get the postbacks to work fine in a test application/site, but couldn't get it to work on a second site, our main site. To get the page to run correctly, I had to take our other site and put it just under the default web site folder.
Background:
- IIS 51
- Same web.config (copies)
- Same references
As seen through IIS
Web Sites/Default Web Site/TestApp - The AJAX functionality worked
Web Sites/Default Web Site/dir/MainApp - the AJAX functionality did NOT work
We created a new virtual directory/app as the following:
Web Sites/Default Web Site/MainApp - The AJAX functionality worked.
So, I'm not sure why, but for some reason, just by putting our application under a subdirectory caused the AJAX errors mentioned above.
Thursday, May 22, 2008 1:20 PM
This might be late in responding, but I had the same issue. In our case, I could get the postbacks to work fine in a test application/site, but couldn't get it to work on a second site, our main site. To get the page to run correctly, I had to take our other site and put it just under the default web site folder.
Background:
- IIS 51
- Same web.config (copies)
- Same references
As seen through IIS
Web Sites/Default Web Site/TestApp - The AJAX functionality worked
Web Sites/Default Web Site/dir/MainApp - the AJAX functionality did NOT work
We created a new virtual directory/app as the following:
Web Sites/Default Web Site/MainApp - The AJAX functionality worked.
So, I'm not sure why, but for some reason, just by putting our application under a subdirectory caused the AJAX errors mentioned above.
I had the same problem. As soon as I moved it just under the default web site folder it worked fine. Thanks!
Thursday, May 22, 2008 11:17 PM
Hi
It is not a good practice to use Response.Write or server.execute from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
Because of the way updatepanels manage the DOM elements within them, you cannot use Response.Write() with them.
http://vijaymodi.wordpress.com/2007/04/13/syswebformspagerequestmanagerparsererrorexception/
http://forums.asp.net/t/1038252.aspx
Adding <pages enableEventValidation="false"/> to your web.config (inside system.web) usually works when setting ValidateRequest="false" does not.
For more information about EnableEventValidation, see: http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableeventvalidation.aspx
Tuesday, July 7, 2009 2:10 PM
I also got a similar error!
I added the following tag in the <system.web> section of web.config and it worked
<xhtmlConformance mode="Transitional"/>
Thursday, April 29, 2010 4:18 PM
I had the exact same problem. Out of the blue. Changing the <xhtmlConformance mode="Transitional"/> in web.config fixed it for me.
Wednesday, March 30, 2011 5:00 AM
I had the same problem.. integrating my site (asp net) in a web portal (asp classic)!!
..and changing the <xhtmlConformance mode="Transitional"/> in web.config fixed it for me!!
THANK YOU SO MUCH!!!! XD
Monday, July 2, 2012 11:53 AM
Here's a solution to this error if you're receiving it only on the iPad in full-screen mode.
The problem turned out to be related to a header the iPad was sending to ASP.Net. I've outlined the solution here: http://joshmouch.wordpress.com/2012/07/02/sys-webforms-is-undefined-on-ipad/
Basically, you just have to tell ASP.Net that the iPad in full screen mode supports ajax.
protected override void OnPreInit(EventArgs e)
{
if (Request.UserAgent != null && Request.UserAgent.IndexOf("AppleWebKit", StringComparison.CurrentCultureIgnoreCase) > -1)
{
this.ClientTarget = "uplevel";
}
base.OnPreInit(e);
}