简体   繁体   中英

Update Panel - Automatically Triggering Server-Side Code & Receving Progress

I have an ASP.NET web form that triggers a set of server-side functions on Page_Load event. Sometimes these functions could take a few minutes to finish executing. Therefore, I'm trying to convert the page so that the functions are triggered after page load possibly through an update panel but without the user's input.

For the sake of simplicity, if there are three functions (Function1, Function2 and Function3), I would like for my web form to load and display Running Function1 . After the first function is complete, would like the update panel to update its status, displaying Function1 complete. Running Function2 Function1 complete. Running Function2 and so on.

I guess a timer could be used to periodically request the server for an update or trigger the next function, but is it possible to do this automatically and have my functions at the same time update the web form?

Anything like Windows forms background workers that could be used in web forms?

If you are using .net 4.5 you can use PageAsyncTask

MSDN - PageAsyncTask Class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM