Configure retry timeout and retry count

The Syncfusion® ASP.NET Core PDF Viewer can automatically retry failed AJAX requests by using the retryTimeout and retryCount properties. Configure these settings to handle transient network errors or brief service outages without interrupting the document viewing experience.

Set retryTimeout to define how long (in seconds) the viewer waits before retrying the failed request, and use retryCount to control how many attempts occur before the viewer reports an error. By default, retryTimeout is 0, which disables the retry delay and causes the viewer to keep the request open indefinitely, while retryCount defaults to 0, meaning no additional attempts occur.

Assign positive values to both properties to limit how long the viewer waits for a response and how many retries should run before surfacing an error message.
Use the properties in Razor markup as shown below. This sample demonstrates a server-backed viewer configuration.

@{
    ViewData["Title"] = "Home page";
    double RetryTimeout = 10;
    double RetryCount = 5;
}

<div class="text-center">
    <ejs-pdfviewer id="pdfviewer"
                   style="height:600px"
                   serviceUrl="/Index"
                   retryTimeout="@RetryTimeout"
                   retryCount="@RetryCount"
                   documentPath="Data/PDF_Succinctly.pdf">
    </ejs-pdfviewer>
</div>

In the sample, retryTimeout is set to 10 seconds and retryCount to 5. If the service does not respond within 10 seconds, the viewer aborts the request and queues a new attempt. The process continues until the document loads or all five retries finish without success.

Monitor the ajaxRequestFailed event to log or display messages when the viewer exhausts all retries. This makes it easier to alert users and diagnose persistent outages.

View sample in GitHub