iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
i cant find a samle of this, but is it possible to update the WebProgressBar on the server side code so that it will show the updates on the client in an ajax way? DUring an InitializePostBack i want to show the progress of what i am doing.
Eric
I’d like to suggest you to check the FreshMartForm_ControlEvents.aspx sample file in WebEssentials sample project or check the live version in here. In the sample, the value of WebProgressBar is updated on the server-side code.
Should you have different scenario, please kindly let us know.
that is way more complex then i want.
I just want to trigger a step on the client side, from the server side.
I have a task that will delete many items, that occurs on the server side (from a webgrid) and i want to show the progress of the delete.
I enclosed one simple sample of WebProgressBar. In this sample, during the OnBatchUpdate event of WebGrid a thread will be triggered. This thread is used to simulate the deleting process.
Please have the attached sample evaluated on your end and let us hear whether it helps or not.
i have tried something using your code but something strange happens. The bar updates AFTER all of the things have processed. So it will process 10 deletes, and then it will show all at once the 10 steps of the bar, after its done.
{
progBar.Start();
progBar.DoStep();
}
Server code
In the Delete process on server.
WebGridCollections.ClientAction.InvokeScript("ProgressBarIncrement()");
Thank you for the sharp observation. I have modified the sample so that the grid’s deletion process and the progress bar shows synchronously.
In the previous sample, I tried to simulate the deletion process by creating a thread and then suspend this thread for a specified time. The result is that WebGrid will finish the deletion process first and progress bar updates its value later.
This approach is not correct to simulate the deletion process. WebGrid deletion process has its own thread and the suspended thread (which is used to update the value of progress bar) is another thread. Nothing hold/pause the deletion process of WebGrid. We should put the hold/suspend on the deletion process of WebGrid.
I enclosed the modified version of the sample as attachment.
switch (rowChanges.RowState) { case RowState.Added: ... break; case RowState.Modified: ... break; case RowState.Deleted: //customer = DataLayer.GetCustomer(rowChanges.KeyValue.ToString()); //DataLayer.DeleteCustomer(customer); Session["SimulatedVal"] = int.Parse(Session["SimulatedVal"].ToString()) + 20; Thread.Sleep(500); break; }
In the sample, the value of “SimulatedVal” session is incremented by 20 (the maximum value is 100; it is used to simulate when user deletes 5 rows). Each time WebGrid process a single row deletion, the value will be incremented by 20. You should change this value to 10 if there are 10 rows to be deleted; or change it to 25 if there are 4 rows to be deleted; and so on. After incremented, the deletion process is simulated by put the grid’s thread into sleep for about 500 millisecond.
Please have the sample evaluated on your and let us hear your response.
that doesnt change how it works in our system. It still shows the progress after the server is done.
Any ideas why? I have attached the actual files here.
WebProgressBar will periodically check the progress of the process in OnProgressInterval server-side event. The interval value of Progress Bar for ProgressInterval event handler is defined in Interval property.
I suspect that the deletion process has finished before the WebProgressBar’s interval check.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname