Thursday, February 24, 2011

Sys.Webforms.PageRequestManagerServerErrorException

I have been for the last 3 days engaged in an almost futile attempt to debug a certain AJAX error was apparently emanating from some Telerik ajax controls. this error is manifested quite randomly

Sys.Webforms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server the status code returned on from the server was: 500

Despite countless hours in asp.net and Telerik Rad Control forums , extensive searches using Google and deep diving in reputed ASP.NET blogs, I could not find a resolution to it. Until one of my colleagues decided to do some excavation work on the event viewer and there it was (among many more):

Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at Telerik.Web.UI.GridItemCollection.get_Item(Int32 index)
at ECP.CERS.ControlLibrary.PassGrid.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) in G:\SVN All\cers\ECP.CERS\ECP.CERS.ControlLibrary\PassGrid.cs:line 2794
at ECP.CERS.Website.AppCode.PageController.CERSBasePage.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) in G:\SVN All\cers\ECP.CERS\ECP.CERS.Website\AppCode\PageController\CERSBasePage.cs:line 578
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

To which I breathe a huge sigh of relief and Since then I have rediscovered the use of the eventviewer in debugging code running in production environments. Apparently the message occurs when an asp.net thread dies and it returns the status code 500.

but something is puzzling - Most people seem to have stopped reporting this bug online (it seems to have been quite prevalent circa. 2008-2009) but disappeared - except in my case. strange!!
(FYI: I am using the VS2010 Enterprise, .NET 4.0 Windows 7, latest release of telerik but it was still occurring....strange)

Lesson: Eventviewer is your friend! then Google comes later, the only time Google beats the Eventviewr is when you do search and Google lands you here - coz thats something the eventviewer cannot do :).

Tuesday, February 22, 2011

WP7 uses PC's network connection

Something really cool on WP7 I discovered today - it may already have been public knowledge for others but I really find it so so cool in order to go around an already documented flaw in that WP7 does not connect to WIFI using static IP Addresses.

The thing I just discovered is that when the phone is connected to your PC/Laptop, the apps that require network data access actually use your PC's network connectivity. Which I find really awesome. So you could easily configure your laptop to use WIFI via a static IP address and then connect your phone to it - and bombs away!

Still waiting for the 'updating' update....