SignalR was created to precisely solve the problem you are describing.
Here is your situation: You need a way to display information that can change constantly. The latest information should be displayed at any time.
Web Forms UpdatePanel. . , . "", , .
, deostroll, AJAX . , , . / , . , :
Client -> Server - Send me the entire table.
Server -> Client - Here a 1MB table.
Client -> Server - Send me the entire table.
Server -> Client - Here an 1MB table.
Client -> Server - Send me the entire table.
Server -> Client - Here a 1.5MB table.
Client -> Server - Send me the entire table.
Server -> Client - Here a 1MB table.
AJAX :
3:30PM Client -> Server - The last data I have is from 3:30PM. Got anything new?
3:30PM Server -> Client - No.
3:31PM Client -> Server - The last data I have is from 3:30PM. Got anything new?
3:31PM Server -> Client - No.
3:32PM Client -> Server - The last data I have is from 3:31PM. Got anything new?
3:32PM Server -> Client - No.
3:33PM Client -> Server - The last data I have is from 3:32PM. Got anything new?
3:33PM Server -> Client - Yes, two new records. Here you go, 10KB.
3:34PM Client -> Server - The last data I have is from 3:33PM. Got anything new?
3:34PM Server -> Client - No.
. , , , deostroll.
, SignalR. SignalR - " ". "" . , , -, . -, SignalR . , .
SignalR. , , JavaScript , .
.
public class TableHub : Hub
{
}
, :
$(function () {
var tableHub= $.connection.tableHub;
tableHub.client.tableChanged= function (html) {
};
});
, , , :
var context = GlobalHost.ConnectionManager.GetHubContext<TableHub >();
string html="<table><tr><td>Some data</td></tr></table>";
context.Clients.All.TableChanged(html);
tableChanged() , ! . , (-, Server Sent, Long Polling), dynamics .
. HTML , . , AJAX- API , . , , -, , .