Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. @model IEnumerable<iCare.Models.HttpPop3>
  2.  
  3. @{
  4. ViewBag.Title = "Index";
  5. }
  6.  
  7. <h2>Index</h2>
  8.  
  9. <p>
  10. @Html.ActionLink("Create New", "Create")
  11. </p>
  12. <div class="row">
  13. <div class="col-md-12">
  14. <div id="httpPop3sTable"></div>
  15. </div>
  16. </div>
  17. @section Scripts{
  18. <script src="/Scripts/jquery.signalR-2.1.2.js"></script>
  19. <!--Reference the autogenerated SignalR hub script. -->
  20. <script src="/signalr/hubs"></script>
  21. <script type="text/javascript">
  22. $(function () {
  23. // Declare a proxy to reference the hub.
  24. var notifications = $.connection.tableHub;
  25.  
  26. //debugger;
  27. // Create a function that the hub can call to broadcast messages.
  28. notifications.client.updateHttpPop3s = function () {
  29. getAllHttpPop3s()
  30.  
  31. };
  32. // Start the connection.
  33. $.connection.hub.start().done(function () {
  34. alert("connection started")
  35. getAllHttpPop3s();
  36. }).fail(function (e) {
  37. alert(e);
  38. });
  39. });
  40.  
  41.  
  42. function getAllHttpPop3s() {
  43. var tbl = $('#httpPop3sTable');
  44. $.ajax({
  45. url: '/httpPop3/GetHttpPop3s',
  46. contentType: 'application/html ; charset:utf-8',
  47. type: 'GET',
  48. dataType: 'html'
  49. }).success(function (result) {
  50. tbl.empty().append(result);
  51. }).error(function () {
  52.  
  53. });
  54. }
  55. </script>
  56. }
  57.  
  58. bundles.Add(new ScriptBundle("~/bundles/noty").Include(
  59. "~/Scripts/noty/layouts/",
  60. "~/Scripts/noty/themes/",
  61. "~/Scripts/noty/jquery.noty.js"));
  62.  
  63. bundles.Add(new ScriptBundle("~/bundles/SignalR").Include(
  64. "~/Scripts/jquery-2.1.1.js",
  65. "~/Scripts/jquery.signalR-2.1.2.js",
  66. "~/Scripts/hubs.js"));
  67.  
  68. @Scripts.Render("~/bundles/noty")
  69. @Scripts.Render("~/bundles/signalr")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement