This is a migrated thread and some comments may be shown as answers.

Weird error

5 Answers 88 Views
Input
This is a migrated thread and some comments may be shown as answers.
Lucania
Top achievements
Rank 1
Lucania asked on 19 Mar 2012, 02:59 AM
Hi,

Not sure this is the best forum for this but I couldn't find a better one, so please move it if there is a better place for it.

Recently, we started converting our website to use RadInputManager instead of Microsoft Validators. All works great, and looks much nicer. However, about the same time, we started getting errors from MicrosoftAjax.js:

Sys.WebForms.PageRequestManagerServerErrorException: Unable to cast object of type 'System.String' to type 'System.Collections.IDictionary'

Refreshing the page does not get rid of the error, but navigating to a different page than back again does. This only seems to occur after a long period of inactivity, but it's very intermittent and I have been unable to reliably reproduce it. It happens both in our dev environment using the dev web server and debug MS library, and our test environment using IIS6 and the non-debug MS library.

I'm not sure this is related to Telerik, but it only started happening around the time we started converting to RadInputManager, leading me to believe there may be a connection. Note however that it is not only pages with a RadInputManager that produce the error.

Has anyone else seen this?

Thanks for any info,

Ross Crawford

5 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 Mar 2012, 06:08 PM
Hi Ross Crawford,

It looks to be a server side exception on your page. The framework sends to the client some details, and the you get the JavaScript exception that you get.

First disable the Ajax on your page: Comment out all UpdatePanels that you use and set EnableAjax="false" to your RadAjaxManager/RadAjaxPanel if you use any.

Then test your site till you get the server side exception. Now when this happens you will see the CallStack printed as response in your browser, which will be far more detailed that the JavaScript exception that you currently get.

Share with us the callstack if you are not able to determinate the problem, and we will try to provide you further help.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lucania
Top achievements
Rank 1
answered on 19 Mar 2012, 11:46 PM
Thanks for the reply. I set EnableAJAX="false", and got the attached stack trace. Looks to be something internal to .NET, but note again that navigating to a different page then back causes the error to disappear. May this be something to do with compilation being incomplete or something weird like that?

[InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Collections.IDictionary'.]
   System.Web.UI.Page.RegisterRequiresControlState(Control control) +104
   System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) +32
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Control.InitRecursive(Control namingContainer) +210
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
   System.Web.UI.ControlCollection.Add(Control child) +80
   System.Web.UI.WebControls.Login.CreateChildControls() +175
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +23
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +327
   System.Web.UI.Page.FindControl(String id) +38
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +232
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743

0
Lucania
Top achievements
Rank 1
answered on 21 Mar 2012, 12:38 AM
Hmmm it gets weirder. It appears to happen ONLY in Chrome. Have tried Firefox, IE, Opera, no error. Looks like it isn't Telerik related at all.

Ross Crawford
0
Vasil
Telerik team
answered on 21 Mar 2012, 12:36 PM
Hi Ross Crawford,

Indeed it looks strange that such error happens only in Chrome. To gain some more information you could run your project in Debug mode. This will allow you to see for which Control the RegisterRequiresControlState fails. If it is some RadControl then we could perform some further investigations and testing. If you are hosting your site on IIS, then you will need to attach the VisualStudio's debugger to the IIS's procesс.
In the Web.config modify the  compilation section:

<system.web>
        <compilation debug="true" >


All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lucania
Top achievements
Rank 1
answered on 22 Mar 2012, 12:02 AM
Thanks Vasil, I did that, and it pointed to RadCompression, which I had added a few weeks ago. I removed the handler & browser file, and the error disappeared, so I will re-post in the Compression forum and see if we can find the answer there.

Thanks again for your help

Ross Crawford
Tags
Input
Asked by
Lucania
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Lucania
Top achievements
Rank 1
Share this question
or