Microsoft.Reporting.WebFormsClient.ReportViewer.isLoading Property
Gets a Boolean value that indicates whether the Web page is performing a postback or the client-side control is loading content.
Note |
|---|
|
To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. |
var loading = $find(viewerId).get_isLoading();
When the client-side control is loading content, it can be performing a postback, such as refreshing a report with new data, or loading its content in the browser after a postback. This property does not cause an exception when the Web page or the client-side control is performing a postback. Use this property to check whether the report or page is being updated and whether you can access the methods and properties.
If you are implementing a custom toolbar, you can use this property to toggle the enabled and disabled states of the toolbar items. For example, you can add a script reference to the following JavaScript code in your ScriptManager control to toggle the enabled and disabled state of an external button.
Note |
|---|
|
The ScriptManager control ensures that the referenced script executes before the client-side control is loaded. This allows the event handler to handle all changes to the isLoading property. |
Sys.Application.add_load(function () { $find("ReportViewer1").add_propertyChanged(viewerPropertyChanged); }); function viewerPropertyChanged(sender, e) { if (e.get_propertyName() === "isLoading") { var viewer = $find("ReportViewer1"); var button = document.getElementById("Button1"); button.disabled = viewer.get_isLoading(); } }
In case the client-side control is performing a long-running postback, you can use the Sys.WebForms.PageRequestManager.abortPostBack method to cancel the postback. For example:
function cancelPostBack() { var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prmn.get_isInAsyncPostBack()) { prm.abortPostBack(); } }
Note