This is a migrated thread and some comments may be shown as answers.

Asynchronously updating client

6 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 25 Jun 2010, 12:41 PM
Hi,
I have tried out your radprogressarea for feeding progress back to the client for long running server side processes and it works really well, what I was wondering is whether you have any way of updating eg. custom text boxes or populating grids using a similar method (I don't think ajax can do what I want to do)?
a good example of what I want to achieve would be a grid full of pc names where the client fires off a server side script to ping them, the replies (progress) would then update the grid in real time to show success or failure.

6 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 30 Jun 2010, 12:34 PM
Hi Al,

Take a look at the follwing online example:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/livedata/defaultcs.aspx

I think it will prove helpful to your own implementation.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 01 Jul 2010, 02:30 PM
Thanks Tsvetoslav, this is very helpful. It works fine when a server process is eg. updating a database, then the client can request progress or whatever and the webservice can return it, it doesn't work where the server process is running in memory only.

I don't know if it is possible but I believe this can only work if the client can connect ot the same instance of the webservice every time it requests progress.
0
Tsvetoslav
Telerik team
answered on 02 Jul 2010, 11:13 AM
Hello Al,

Still the starting point of the progress update should be set by the client itself - i.e. the client (browser) should ping the server for the information and then update itself with the response. Since the response cannot be coming into portions, you can set the web service to be called in very small time intervals, poll the server process (how exactly depends on your particular scenario), pull the data and get back to the client with the update.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 05 Jul 2010, 12:47 PM
Is there any way to ajaxify a javascript submit with the ajax manager? eg. I would have a setInterval runing on the client that would submit the form where certain ui elements would be updated in the browser but I'd like to use ajax. I can get it working fine with a manual button click (an ajaxified button with UseSubmitBehavior=false) but would like to make the refresh automatic.
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 05 Jul 2010, 01:22 PM
I found one way to do it that works:

 

 


var btn = document.getElementById('<%= bRefresh.ClientID %>');
if (btn) { 
    btn.click();
}

Is there maybe a more elegant solution?

0
Tsvetoslav
Telerik team
answered on 08 Jul 2010, 06:49 AM
Hi Al,

You can do so through the RadAjaxManager control as follows:

1. Add the following ajax setting to it:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <%--..... The controls to be asynchronously updated by the ajax request--%>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>    
</telerik:RadAjaxManager>

2. Attach an event handler to the RadAjaxManager's server-side OnAjaxRequest event.

3. Fire the ajax request fromt the browser as follows:

<telerik:RadScriptBlock ID="ScriptBlock1" runat="server">
    <script type="text/javascript">
        function fireRequest()
        {
            $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest(<%--here go any arguments top be passed top the server--%>);
        }
    </script>
</telerik:RadScriptBlock>

Hope it helps.

Greetings,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Tsvetoslav
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or