Skip to content

Use the WebMethod attribute to get information about the current progress from the server and display it on the client without refreshing the whole page. To enable this functionality, use the jQuery library or ScriptManager page.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-web-forms-progress-bar-display-server-process-progress

Repository files navigation

Progress Bar for ASP.NET Web Forms - How to use the WebMethod attribute to display the progress of a server-side process on the client

This example demonstrates how to use the WebMethod attribute to get information about the current progress from the server and display it on the client without refreshing the whole page. To enable this functionality, use the jQuery library or ScriptManager page.

Use WebMethods to display the server-side process

Overview

Add the WebMethods attribute to the BasePage class as follows:

[WebMethod(EnableSession = true)]

For the jQuery approach, send a POST request to the WebMethod:

function WebMethodRequest(url, callback) {
    $.ajax({
        url: url,
        type: "POST",
        contentType: 'application/json; charset=utf-8',
        success: callback
    });
}

For the ScriptManager technique, call the StartOperation method:

function callbackStart(s, e) {
    // ...
    PageMethods.StartOperation();
    // ...
}

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Use the WebMethod attribute to get information about the current progress from the server and display it on the client without refreshing the whole page. To enable this functionality, use the jQuery library or ScriptManager page.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •