In certain applications, there might be a need to display the server exception, if any, raised during an AJAX call, for information/troubleshooting on the client. In this recipe, we will see how to retrieve the server exception and the XmlHTTPRequest statuses on the client.
We will go about by posting an AJAX request for a file retrieval from the server. We will intentionally throw an IO exception on the server and capture the same on the client.
Recipe3.aspxto the current project.
<form id="form1" runat="server"> ...