Click here to Skip to main content
15,177,127 members

Comments by kellyapt1 (Top 6 by date)

kellyapt1 25-Aug-15 13:59pm View
How are you hosting that code - how do you have it deployed on your machine? Do you have the necessary ports open on your machine?
kellyapt1 13-Aug-15 15:06pm View
One approach would be to have a function that each of the controls calls which would keep a count of the number of controls that have called it. Once that number has been reached and the document is ready then the call would be made to connection.hub.start().

See an example here:
kellyapt1 11-Aug-15 17:54pm View
As RyanDev has indicated, using $('div').each will pop up an alert for all of the divs on the page. To have an alert for a specific div use the ID of the div like this:

$('#div1').each(function () {
alert( $(this).attr('title'));
kellyapt1 10-Aug-15 15:37pm View
First, put a breakpoint in your controller and make sure that more than one object is coming back from your query.

Second, make sure that you are properly declaring the model object in your view as an IEnumerable.

For example, in my controller I have:

public IActionResult Index()
var x = new List<testclass> { new TestClass { PartNumber = "1000" },
new TestClass { PartNumber = "2000" } };
return View(x);

And in the view, I have:

@model IEnumerable<webapplication2.models.testclass>

@foreach (var item in Model)
<div>@Html.DisplayFor(modelItem => item.PartNumber)</div>

kellyapt1 7-Aug-15 18:25pm View
Fair enough. Did not know that I can reply directly like that - first time really doing anything in this forum. Lesson learned. Thanks.
kellyapt1 7-Aug-15 18:23pm View
Good recommendations (especially around the params). With the "try to tell it clearly...", I thought that keeping it simple in terms of not returning another task would make things simpler to understand.

If I were to return a Task from this method I would make it generic and return an array of HttpResponseMessages:

static Task<httpresponsemessage[]> Run()
return Task.WhenAll(task1, task2);