RepeatHost Business Hosting

AJAX

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>

Disable Button on Submit (Prevent multiple submits)

When a user clicks a button on a web page that submits the page (or does an AJAX asynchronous submit), depending on the load on the server and latency, the user may have to wait upwards of many seconds in order for the process to complete. During the time, a user may think something has not worked and may attempt to click the button again, even multiple times. If you are doing complex operations, it could cancel these actions and start over. Worse yet, if you are inserting items in a database, it could cause duplicate entries or other concurrency issues.

How to Install the ASP.NET AJAX Control Toolkit

There is no installer available for the Ajax Control Toolkit. You have to configure it manually. Here are the following steps to correctly install the toolkit.

- Unpack the AjaxControlToolkit-Framework3.5-NoSource.zip file to a local directory. You can download it here:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxControlToolkit

- Create a "Microsoft ASP.NET" directory at the following path: