Showing posts with label sys. Show all posts
Showing posts with label sys. Show all posts

Wednesday, March 28, 2012

pageLoad fires before script references are loaded

I have an aspx page with:

- a scriptmanager that has 2 script references. Both scripts have the "if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();" line at their end.

- a script section with a pageLoad function that calls a function defined in one of the 2 script references.

- an iframe (with src set to about:blank).

Result:

I get an "object undefined" error in the pageLoad function. with fiddler and in the debugger I can see that my script rerefences have not yet been loaded. As fas as I know, they should! It always worked until we added the iframe control. Removing the iframe control resolves the problem. To me this looks like an error in ajax where the pageLoad is executed on the load of the iframe contents instead of on the load of the main page.

Anyone any suggestion?

Could you share some code that reproduces this bug? I was unable to get the behavior you describe.

Are you using a function named pageLoad? Or Sys.Application.add_load(...)? Or Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(...)? Code would help a lot.


Thanks for looking into the problem. I will try to assemble a minimal solution that exposes the bug. BTW: it is a pageLoad function. In the debugger I saw that Ajax in the onload event looks if it exists and, if so, calls it. That's also how I found out that it gets called twice from this event handler. Give me some time to assemble the solution.

Thanks agian,

Erwin

Monday, March 26, 2012

PageRequestManagerServerErrorException 12019 12130 12031 and 12152

Any ideas what causes the following error message:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code is:

I receive one of 4 error numbers: 12019 12130 12031 or 12152

I believe it might have to do with a content switch but not sure. Any help would be greatly appreciated.

I am getting the same Error Message with error number :12031...

Any suggestion ?


Hi,

Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.


Hi,

it is true that it is about Wininet api.i can access my page and can work with Another browsers but with IE 7.0 OR 6.0 i come accross with this error.(in I.E The error code is 404)..What is ur advice to solve this problem?When i launch the project without connecting to source safe,it works but after i connect to sourcesafe,this problem occurs..This error is very annoying.What should i do?Thank u very much for ur Help.(My problem doesnt depend on Data Intesivity or row count)


Raymond Wen - MSFT:

Hi, Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.

So, seeing this error on a partial-page update (UpdatePanel Async postback) means that the application I'm developing is not going to work with Internet Explorer? Or is this just a fluke that will go away on a restart / deployment scenario / etc.

I'm getting this one:

 12019 ERROR_INTERNET_INCORRECT_HANDLE_STATE
The requested operation cannot be carried out because the handle supplied is not in the correct state.



Hi

we had the same problem on our live-system. It was caused by SSL-Connection. If you have SSL, try turning off Keep Alive for IE.


hth


Just so you know, we did find one possible cause of this problem.

It seems to crop up sometimes if you are using IE6 supplied with MultipleIEs package.

http://forums.asp.net/t/1123365.aspx

PageRequestManagerServerErrorException (Status Code: 413)

I hope someone can help me.

This is the message:
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 413.

The scenerio is quite simple: A master page contains the Script Manager. The others pages have their own update panels and controls (nothing special, just list box and grids).

Sometimes the above error ocurrs, sometimes not.

The application is on HTTPS and requires client certificates.

Any idea?

Regards,
Alano

Hi Alano,

The status code 413 means that Request Entity Too Large.
The 413 status code indicates that the request was larger than the server is able to handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.

Please?try?to set the maxRequestLength property to a larger value. For how, please refer to this:
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

Hope this helps.

Raymond,

Thanks very much for your answer, the first about this problem I've seen on the Internet.
Our web.config already has a maxRequestLength set to 2000000. We don't expect use this, but we have it on web.config. I also have set the UploadReadAHeadSize on IIS 6.0 to 64k.
If you have another hint, I'll appreciate that.

Thanks again.

Alano.


We solved our problem, I suppose, with a IIS metabase parameter (UploadReadAHeadSize).
Some pages of our web site has more than 80k. I have set the that IIS metabase parameter to 128k and things are going now.
For more information you can see:
http://technet2.microsoft.com/windowsserver/en/library/0ef55842-24d2-4060-bb98-d69e2877a6671033.mspx?mfr=true

Saturday, March 24, 2012

PagingBulletedListExtender not working anymore

After Beta 2 installation PagingBulletedListExtender is not working anymore, just creates one long bulleted list. And more, notorious error 'SYS is undefined'. All changes suggested in the migration to Beta2 guide done.

"Sys is undefined" almost always means ASP.NET AJAX isn't installed correctly. If the following from its release notes doesn't help, please follow up in one of the other ASP.NET AJAX forums:

* A new ScriptResource handler has been added that requires the following entry in the Web.config
file:

<add verb="GET"
path="ScriptResource.axd"
type="Microsoft.Web.Handlers.ScriptResourceHandler"
validate="false"/>

This handler requires an entry in the Web.config file. If the entry is missing, you might see the
following error:

'Sys' is undefined.


ScriptResource handler was added to web.config
Please reply with acomplete, simple, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

<%@. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Paging Bulleted List</title>
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>

<ajaxToolkit:PagingBulletedListExtender ID="PBLE1" runat="server"
TargetControlID="BulletedList1"
ClientSort="true"
IndexSize="1"
Separator=" - "
SelectIndexCssClass="selectIndex"
UnselectIndexCssClass="unSelectIndex" />

<asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="Text" DataSourceID="mySqlDataSource" DataTextField="CompanyName" DataValueField="CustomerId">
<asp:ListItem>Blur</asp:ListItem>
<asp:ListItem>Brand</asp:ListItem>
<asp:ListItem>Color</asp:ListItem>
</asp:BulletedList>

<asp:SqlDataSource ID="mySqlDataSource" runat="server" EnableCaching="true"
ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"
SelectCommand="SELECT CustomerId, CompanyName FROM customers" >
</asp:SqlDataSource>

</div>


</form>
</body>
</html>

=================

Web.Config :

...

<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</handlers>
...


I removed the SQL and code-behind dependencies from the sample above and tried it in the SampleWebSite directory of the 61126 Toolkit where it appears to work fine to me:

<%@. Page Language="VB" AutoEventWireup="true" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Paging Bulleted List</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <ajaxToolkit:PagingBulletedListExtender ID="PBLE1" runat="server" TargetControlID="BulletedList1" ClientSort="true" IndexSize="1" Separator=" - " SelectIndexCssClass="selectIndex" UnselectIndexCssClass="unSelectIndex" /> <asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="Text"> <asp:ListItem>Blur</asp:ListItem> <asp:ListItem>Brand</asp:ListItem> <asp:ListItem>Color</asp:ListItem> </asp:BulletedList> </div> </form></body></html>

Yes, it works. The problem was in my Web.config

I added before ScriptResource to the handlers of the section system.webServer, and now I added this ScriptResource to the httpHandlers of the system.web section.

Now it works perfect. Thank you.