Skip to content

Use an HTTP handler to get information about the current progress from the server and display it on the client without refreshing the whole page.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-web-forms-use-httphandler-to-display-server-side-process-progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASP.NET Web Forms - How to use HTTP handlers to display the progress of a server-side process on the client

This example demonstrates how to use an HTTP handler to get information about the current progress from the server and display it on the client without refreshing the whole page.

HTTP handlers to display the progress

Overview

Declare a custom HttpHandler class to send a request from the client to the server and return information about the current progress without refreshing the whole page.

public class TestHandler : IHttpHandler, IRequiresSessionState {
    String GetProgress(HttpSessionState session) {
        if(session == null || !(session["_Operation"] is Operation))
            return "NaN";
        var progress = (session["_Operation"] as Operation).Progress;
        return progress.ToString();
    }

    public Boolean IsReusable {
        get { return false; }
    }

    public void ProcessRequest(HttpContext context) {
        var response = GetProgress(context.Session);
        context.Response.CacheControl = "No-cache";
        context.Response.Write(response);
    }
}

Note
After you create a custom HttpHandler class, register it in the Web.config file. For more information, refer to the following article: How to: Register HTTP Handlers.

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 an HTTP handler to get information about the current progress from the server and display it on the client without refreshing the whole page.

Topics

Resources

License

Stars

Watchers

Forks