public class DeviceData { public string DeviceName { get; set; } public string IPAddress { get; set; } }
<body> <h1>Device List</h1> <div id="DeviceTable"> <table border="1"> <thead> <tr><td>DeviceName</td><td>IPAddress</td></tr> </thead> <tbody> <tr class="loading"><td colspan="5">loading...</td></tr> </tbody> </table> <input type="button" id="GetDeviceData" value="GetDeviceData" /> </div> <!--Script references. --> <!--Reference the jQuery library. --> <script src="Scripts/jquery-1.6.4.min.js" ></script> <!--Reference the SignalR library. --> <script src="Scripts/jquery.signalR-2.1.2.min.js"></script> <!--Reference the autogenerated SignalR hub script. --> <script src="signalr/hubs"></script> <script type="text/javascript"> $(function () { //Set the hubs URL for the connection var url = 'http://localhost:8080/signalr'; var connection = $.hubConnection(url); // Declare a proxy to reference the hub. var hubProxy = connection.createHubProxy('HubClass'); //var DeviceTextBox = $('#message'); var $DeviceTable = $('#DeviceTable'); var $DeviceTableBody = $DeviceTable.find('tbody'); var rowTemplate = '<tr><td>DeviceName</td><td>IPAddress</td></tr>'; hubProxy.on('DeviceDataResults', processDeviceDataResults); connection.start().done(function () { $('#GetDeviceData').click(function () { hubProxy.invoke('GetDeviceData'); }); }); function processDeviceDataResults(DeviceName) { $DeviceTableBody.empty(); //Here I need to upload my table data }; }); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)