<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about AJAX </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/2877681.aspx</link><pubDate>Mon, 19 Jan 2009 23:16:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2877681</guid><dc:creator>Mustang65</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2877681.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2877681</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;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.&amp;nbsp; The best way to handle this issue is to look for the error in the datasource updated event.&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;Protected Sub&lt;/span&gt; ObjectDataSource1_Updated(&lt;span class="kwd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwd"&gt;As Object&lt;/span&gt;, &lt;span class="kwd"&gt;ByVal&lt;/span&gt; e &lt;span class="kwd"&gt;As&lt;/span&gt; System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs) &lt;span class="kwd"&gt;Handles&lt;/span&gt; ObjectDataSource1.Updated&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;If Not&lt;/span&gt; IsNothing(e.Exception) &lt;span class="kwd"&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox( e.Exception.InnerException.ToString)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.ExceptionHandled = &lt;span class="kwd"&gt;True&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/span&gt;&lt;/p&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p&gt;&lt;font color="#000000" size="2"&gt;This will trap the error and you should be able to see it at this point.&amp;nbsp; From what I have seen you must use the InnerException for the true error message.&amp;nbsp; The message portion of the exception only contains the generic error text.&amp;nbsp; I have been using this and it seems to work very well.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/1611144.aspx</link><pubDate>Thu, 08 Mar 2007 12:19:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1611144</guid><dc:creator>VR2</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1611144.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1611144</wfw:commentRss><description>&lt;p&gt;Was this resolved at all?&amp;nbsp;I have a similar issue:&lt;/p&gt;
&lt;p&gt;Steps to Reproduce&lt;/p&gt;
&lt;p&gt;1) I have a DB table with a column which is varchar(1024)&lt;/p&gt;
&lt;p&gt;2) I want this column to only contain unique strings&lt;/p&gt;
&lt;p&gt;3) So I add a trigger to the column to check for the data entered&amp;nbsp;and use&amp;nbsp;RaisError if any problems&lt;/p&gt;
&lt;p&gt;4) I setup my Datagrid/ObjectDataSource/BLL/DAL and all works fine in aspx, the page errors with the correct message. &lt;/p&gt;
&lt;p&gt;5) I add in an AJAX Update Panel and *it* (the&amp;nbsp;ASP.NET AJAX Libraries)&amp;nbsp;just spits out a JSON string containing an alert message&amp;nbsp;"An exception occured&amp;nbsp;by the&amp;nbsp;the&amp;nbsp;target of an invocation". THAT is not the correct error string. &lt;/p&gt;
&lt;p&gt;Why is it not? and how do I alter this behaviour to make it send a JSON string containing the correct Error message?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;</description></item><item><title>Re: Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/1611143.aspx</link><pubDate>Thu, 08 Mar 2007 12:19:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1611143</guid><dc:creator>VR2</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1611143.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1611143</wfw:commentRss><description>&lt;p&gt;Was this resolved at all?&amp;nbsp;I have a similar issue:&lt;/p&gt;
&lt;p&gt;Steps to Reproduce&lt;/p&gt;
&lt;p&gt;1) I have a DB table with a column which is varchar(1024)&lt;/p&gt;
&lt;p&gt;2) I want this column to only contain unique strings&lt;/p&gt;
&lt;p&gt;3) So I add a trigger to the column to check for the data entered&amp;nbsp;and use&amp;nbsp;RaisError if any problems&lt;/p&gt;
&lt;p&gt;4) I setup my Datagrid/ObjectDataSource/BLL/DAL and all works fine in aspx, the page errors with the correct message. &lt;/p&gt;
&lt;p&gt;5) I add in an AJAX Update Panel and *it* (the&amp;nbsp;ASP.NET AJAX Libraries)&amp;nbsp;just spits out a JSON string containing an alert message&amp;nbsp;"An exception occured&amp;nbsp;by the&amp;nbsp;the&amp;nbsp;target of an invocation". THAT is not the correct error string. &lt;/p&gt;
&lt;p&gt;Why is it not? and how do I alter this behaviour to make it send a JSON string containing the correct Error message?&lt;/p&gt;
&lt;p&gt;Thank &lt;/p&gt;</description></item><item><title>Re: Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/1606442.aspx</link><pubDate>Tue, 06 Mar 2007 03:33:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1606442</guid><dc:creator>bobthecoder</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1606442.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1606442</wfw:commentRss><description>This error message is about as useful as a chocolate fireguard. Disabling the update panel is fine for development, and the few bugs that I stumble across while developing. But what about in a production situation. If I get my clients phoning up telling me the app won't work becuase an "Exception has been thrown by the target of an invocation", then I'll just explain to them how to disable AJAX so I can get a useful error message. AHH. No. I don't think so. Is there some way that you can actually pass the message text up to the popup box. Dev's like me are pretty reliant on the exception text. Especially as we often just write stuff and then it gets put into production without rigourous testing. Not ideal, but thats what happens in the real world outside of Redmond.&lt;br /&gt;</description></item><item><title>Re: Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/1560826.aspx</link><pubDate>Fri, 02 Feb 2007 13:26:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1560826</guid><dc:creator>michiel1978</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1560826.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1560826</wfw:commentRss><description>Disable the ajax for a moment (EnablePartialRendering="false" on the scriptmanager).&lt;br /&gt;</description></item><item><title>Exception has been thrown by the target of an invocation</title><link>http://forums.asp.net/thread/1559167.aspx</link><pubDate>Thu, 01 Feb 2007 15:01:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1559167</guid><dc:creator>JessyEzzy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1559167.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1559167</wfw:commentRss><description>&lt;p&gt;I have a scriptmanager and updatepanel, inside the panel is a gridview it's&amp;nbsp;bound to an&amp;nbsp;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?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>