Click here to Skip to main content
15,888,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: C# Data access layer and business logic Pin
vinuvasahanponniah19-Apr-17 22:28
professionalvinuvasahanponniah19-Apr-17 22:28 
SuggestionRe: C# Data access layer and business logic Pin
Lehlohonolo Jairus Shole9-May-17 3:01
Lehlohonolo Jairus Shole9-May-17 3:01 
QuestionDropDownList Pin
Member 1116162519-Apr-17 1:57
Member 1116162519-Apr-17 1:57 
AnswerRe: DropDownList Pin
User 418025419-Apr-17 7:25
User 418025419-Apr-17 7:25 
AnswerRe: DropDownList Pin
John C Rayan21-Apr-17 5:02
professionalJohn C Rayan21-Apr-17 5:02 
Questionerror in opening page Pin
amirsamanipoor17-Apr-17 19:07
amirsamanipoor17-Apr-17 19:07 
AnswerRe: error in opening page Pin
User 418025418-Apr-17 4:35
User 418025418-Apr-17 4:35 
QuestionCombine AngularJS with Signalr in C# project. Pin
Member 1056128817-Apr-17 12:46
Member 1056128817-Apr-17 12:46 
Hi,

I am after some guidance how to incorporate angularjs into this project. I am looking for a nicer way of writing the data to the table. Any help would be most appreciated.

C#
public class RaceDayDisplayController : ApiControllerWithHub<RaceDayDisplayHub>
    {
        [HttpPost]
        [Route("api/DoSomething")]
        public HttpResponseMessage DoSomething(Rootobject model)
        {
            Hub.Clients.All.LastSectional(model.sectionTimes[0].runners);
        }
    }






HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Display</title>
</head>
<body>
    <h2>Real-Time Raceday Data</h2>

    <table id="showData"></table>

    <!--Script references. -->
    <!--Reference the Angular library. -->
    <script src="/Scripts/angular.js"></script>
    <!--Reference the jQuery library. -->
    <script src="/Scripts/jquery-1.10.2.min.js"></script>
    <!--Reference the SignalR library. -->
    <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 () {
            var myHub = $.connection.raceDayDisplayHub;

            try {
                $.connection.hub.start();

                myHub.on('LastSectional', function (runners) {

                    $("#showData tr").remove();
                    $('#showData').append('<tr><td width="150">Pos</td><td width="210">Name</td><td width="150">Margin</td><td width="150">Last Sectional</td><td width="150">Cumulative Times</td></tr>');
                    for (var i = 0; i < runners.length; i++) {
                        $('#showData').append('<tr><td>' + runners[i].position + '</td><td>' + runners[i].bookNumber + ' ' + runners[i].name + '</td><td>' + runners[i].margin + '</td><td>' + runners[i].sTime + '</td><td>' + runners[i].cumTime + '</td></tr>');
                    }

                    //var runners = JSON.stringify(test)

                    //var app = angular.module('myApp', []);
                    //app.controller('customersCtrl', function ($scope) {
                    //    $scope.runners = runners;
                    //});
                });

            } catch (e) {
                alert(e.message);
            }

        });

    </script>

</body>
</html>

QuestionHow to interact windows forms app to asp.net c# web Pin
Zeyad Jalil17-Apr-17 2:18
professionalZeyad Jalil17-Apr-17 2:18 
AnswerRe: How to interact windows forms app to asp.net c# web Pin
Afzaal Ahmad Zeeshan17-Apr-17 2:30
professionalAfzaal Ahmad Zeeshan17-Apr-17 2:30 
QuestionUrgent Assistance Pin
Member 1313189416-Apr-17 10:35
Member 1313189416-Apr-17 10:35 
AnswerRe: Urgent Assistance Pin
Afzaal Ahmad Zeeshan16-Apr-17 10:48
professionalAfzaal Ahmad Zeeshan16-Apr-17 10:48 
GeneralRe: Urgent Assistance Pin
ZurdoDev17-Apr-17 2:03
professionalZurdoDev17-Apr-17 2:03 
SuggestionRe: Urgent Assistance Pin
ZurdoDev17-Apr-17 2:03
professionalZurdoDev17-Apr-17 2:03 
QuestionASP.NET MVC Exercise Pin
Moni Shakeera15-Apr-17 10:40
Moni Shakeera15-Apr-17 10:40 
AnswerRe: ASP.NET MVC Exercise Pin
Richard MacCutchan15-Apr-17 20:57
mveRichard MacCutchan15-Apr-17 20:57 
AnswerRe: ASP.NET MVC Exercise Pin
ZurdoDev17-Apr-17 2:04
professionalZurdoDev17-Apr-17 2:04 
QuestionASP.Net Web Application with Devices Pin
Zeyad Jalil14-Apr-17 1:02
professionalZeyad Jalil14-Apr-17 1:02 
AnswerRe: ASP.Net Web Application with Devices Pin
ZurdoDev14-Apr-17 1:15
professionalZurdoDev14-Apr-17 1:15 
GeneralRe: ASP.Net Web Application with Devices Pin
Zeyad Jalil14-Apr-17 3:51
professionalZeyad Jalil14-Apr-17 3:51 
GeneralRe: ASP.Net Web Application with Devices Pin
ZurdoDev14-Apr-17 3:59
professionalZurdoDev14-Apr-17 3:59 
QuestionIn RequireField validator textbox Data is present in the Textbox but its fired Please enter your cardnum1 Pin
Member 1312710613-Apr-17 12:36
Member 1312710613-Apr-17 12:36 
AnswerRe: In RequireField validator textbox Data is present in the Textbox but its fired Please enter your cardnum1 Pin
User 418025418-Apr-17 4:44
User 418025418-Apr-17 4:44 
QuestionHow to configure sql server profiler to see sql for my session only Pin
Tridip Bhattacharjee12-Apr-17 22:36
professionalTridip Bhattacharjee12-Apr-17 22:36 
AnswerRe: How to configure sql server profiler to see sql for my session only Pin
Richard MacCutchan12-Apr-17 23:48
mveRichard MacCutchan12-Apr-17 23:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.