I am trying to implement the SignalR into my ASP.Net "WEB SITE PROJECT". (This is an existing application and it is a Web Site Project, and can not be changed over to be a Web Application.)
I get the following error when I try to run the SignalR Sample code. (This is the basic stock ticker sample. Just wanting to verify I have everything setup correctly before I start implementing this into my existing code.)
Here is the error I get
Unhandled exception at line 71, column 5 in http://localhost:49218/SchoolFinancial/SignalR.Sample/SignalR.StockTicker.js
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'client': object is null or undefined
Here is the javascript that the error is thrown with
// Add client-side hub methods that the server will call
$.extend(ticker.client, {
updateStockPrice: function (stock) {
var displayStock = formatStock(stock),
$row = $(rowTemplate.supplant(displayStock)),
$li = $(liTemplate.supplant(displayStock)),
bg = stock.LastChange === 0
? '255,216,0' // yellow
: stock.LastChange > 0
? '154,240,117' // green
: '255,148,148'; // red
$stockTableBody.find('tr[data-symbol=' + stock.Symbol + ']')
.replaceWith($row);
$stockTickerUl.find('li[data-symbol=' + stock.Symbol + ']')
.replaceWith($li);
$row.flash(bg, 1000);
$li.flash(bg, 1000);
},
marketOpened: function () {
$("#open").prop("disabled", true);
$("#close").prop("disabled", false);
$("#reset").prop("disabled", true);
scrollTicker();
},
marketClosed: function () {
$("#open").prop("disabled", false);
$("#close").prop("disabled", true);
$("#reset").prop("disabled", false);
stopTicker();
},
marketReset: function () {
return init();
}
});
Here is the Web.Config setting change that is to allow SignalR work with a Web Site project
(This is inside of the following section of the Web.Config )
<modules runAllManagedModulesForAllRequests="true">
</modules>
I am NEW to using SignalR and from what I have found from a previous post, this should solve my issue if I can get it working.
So, if anyone has any experience with using the SignalR in a Web Site Project in ASP.Net I would greatly appreciate any suggestions / recommendations.
Not sure if it matters or not, but I am using Visual Studio 2012 (ASP.Net / C#) and my web site is on the .Net Framework 4.5 version.
Thanks in advance for your help...
See Question&Answers more detail:
os