Need a simple CRM and Project Management system?
Check out JobNimbus - CRM for Contractors and Service Professionals.
Check out JobNimbus - CRM for Contractors and Service Professionals.
Ajax - Exception has been thrown by the target of an invocation
If you're working with Ajax in .NET, you'll probably see an exception like this at some point:
Exception has been thrown by the target of an invocation
Not very helpful. What you need to do is tell the ScriptManager to catch post back errors and re-throw the InnerException. Change your ScriptManager to look like this:
<asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError">
</asp:ScriptManager>
Then add this to your code behind:
protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
{
if (e.Exception != null && e.Exception.InnerException != null)
{
ScriptManager1.AsyncPostBackErrorMessage = e.Exception.InnerException.Message;
}}
Now you should see the real exception message come through.
Popular Articles
Last viewed:
- Crystal Reports and ASP.NET
- Fixing Relative Paths in C# ASP.NET When Using Url Rewriting
- ASP.NET Charting Control 3.5 fix for "Error executing child request for ChartImg.axd"
- Enable ASP.NET in IIS 7 for Windows Vista
- SQL Create Table Add Description to Column
- GridView ObjectDataSource LINQ Paging and Sorting

Recent comments
1 day 1 hour ago
4 weeks 3 days ago
4 weeks 3 days ago
5 weeks 4 days ago
5 weeks 4 days ago
5 weeks 5 days ago
8 weeks 4 days ago
9 weeks 5 days ago
11 weeks 4 days ago
12 weeks 2 days ago