Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model IEnumerable<iCare.Models.HttpPop3>
- @{
- ViewBag.Title = "Index";
- }
- <h2>Index</h2>
- <p>
- @Html.ActionLink("Create New", "Create")
- </p>
- <div class="row">
- <div class="col-md-12">
- <div id="httpPop3sTable"></div>
- </div>
- </div>
- @section Scripts{
- <script src="/Scripts/jquery.signalR-2.1.2.js"></script>
- <!--Reference the autogenerated SignalR hub script. -->
- <script src="/signalr/hubs"></script>
- <script type="text/javascript">
- $(function () {
- // Declare a proxy to reference the hub.
- var notifications = $.connection.tableHub;
- //debugger;
- // Create a function that the hub can call to broadcast messages.
- notifications.client.updateHttpPop3s = function () {
- getAllHttpPop3s()
- };
- // Start the connection.
- $.connection.hub.start().done(function () {
- alert("connection started")
- getAllHttpPop3s();
- }).fail(function (e) {
- alert(e);
- });
- });
- function getAllHttpPop3s() {
- var tbl = $('#httpPop3sTable');
- $.ajax({
- url: '/httpPop3/GetHttpPop3s',
- contentType: 'application/html ; charset:utf-8',
- type: 'GET',
- dataType: 'html'
- }).success(function (result) {
- tbl.empty().append(result);
- }).error(function () {
- });
- }
- </script>
- }
- bundles.Add(new ScriptBundle("~/bundles/noty").Include(
- "~/Scripts/noty/layouts/",
- "~/Scripts/noty/themes/",
- "~/Scripts/noty/jquery.noty.js"));
- bundles.Add(new ScriptBundle("~/bundles/SignalR").Include(
- "~/Scripts/jquery-2.1.1.js",
- "~/Scripts/jquery.signalR-2.1.2.js",
- "~/Scripts/hubs.js"));
- @Scripts.Render("~/bundles/noty")
- @Scripts.Render("~/bundles/signalr")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement