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

Exceptions thrown by page show as Javascript error

3 Answers 49 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jayd
Top achievements
Rank 1
Jayd asked on 16 Aug 2011, 09:30 PM
I am working on several pages that have Rad controls.  When I run these pages in the Visual Studio debugger and my server-side code throws an exception, it always shows up as if it is a Javascript exception.  (See the attached screenshot).  I believe this happens whenever I have a RadAjaxPanel on the page.

This means it takes me a very long time to track down the source of the exception.  Since I don't get to see the standard ASP.Net exception message, I don't get to see the file name and line number of where the exception was thrown.

Is there any way to disable this behavior, and show the standard ASP.Net exception message instead?

3 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 17 Aug 2011, 01:15 PM
Hello Jayd,

I'm assuming it doesn't show more details is because of security. Either way, if you want to see the full ASP.NET error message, you could just turn off ajax in your development environment and see exactly where the error is being thrown. Otherwise, you could create your own custom exception class that would add those details in the message of the exception.

I hope that helps.
0
Accepted
Maria Ilieva
Telerik team
answered on 17 Aug 2011, 04:18 PM
Hi Kevin,

Please refer to the following help topic which elaborates on this matter.
Test the provided approaches and verify if they work for you.

Kind regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Jayd
Top achievements
Rank 1
answered on 17 Aug 2011, 05:36 PM
Maria, thank you for the link you provided.  By adding an AsyncPostBackError event handler to my RadScriptManager, I am able to view the Stack Trace.  Currently I'm doing this by setting a breakpoint on the event handler and viewing the value of e.Exception.StackTrace in my Visual Studio watch window.  This is exactly the data I was looking for; this info was very helpful.

I tried writing the stack trace to the page, but couldn't get it to work.  For now, viewing the stack trace in the debugger will be a good start.
Tags
Ajax
Asked by
Jayd
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Maria Ilieva
Telerik team
Jayd
Top achievements
Rank 1
Share this question
or