Last post Feb 05, 2010 01:03 PM by Vivani
Feb 01, 2007 03:01 PM|JessyEzzy|LINK
I have a scriptmanager and updatepanel, inside the panel is a gridview it's bound to an objectdatasource, when I click the select button in the grid I get the alert with the message "Exception has been thrown by the target invocation". How would I know the
source of this error, or what is causing the error. Is there a way to get the real exception that occurred not just a message?
Feb 02, 2007 01:26 PM|michiel1978|LINK
Mar 06, 2007 03:33 AM|bobthecoder|LINK
Mar 08, 2007 12:19 PM|VR2|LINK
Was this resolved at all? I have a similar issue:
Steps to Reproduce
1) I have a DB table with a column which is varchar(1024)
2) I want this column to only contain unique strings
3) So I add a trigger to the column to check for the data entered and use RaisError if any problems
4) I setup my Datagrid/ObjectDataSource/BLL/DAL and all works fine in aspx, the page errors with the correct message.
5) I add in an AJAX Update Panel and *it* (the ASP.NET AJAX Libraries) just spits out a JSON string containing an alert message "An exception occured by the the target of an invocation". THAT is not the correct error string.
Why is it not? and how do I alter this behaviour to make it send a JSON string containing the correct Error message?
Jan 19, 2009 11:16 PM|Mustang65|LINK
I know this is an old post but I do have an answer for it as I have run into the same situation just today. The best way to handle this issue is to look for the error in the datasource updated event.
Protected Sub ObjectDataSource1_Updated(ByVal sender
As Object, ByVal e
If Not IsNothing(e.Exception)
e.ExceptionHandled = True
This will trap the error and you should be able to see it at this point. From what I have seen you must use the InnerException for the true error message. The message portion of the exception only contains the generic error
text. I have been using this and it seems to work very well.
Feb 05, 2010 01:03 PM|Vivani|LINK
I have posted about a similar problem. Do you know if it is possible to pass the error up from the updated event to a central error handler? If so, what would the code in the Updated event look like?