« first day (909 days earlier)      last day (4265 days later) » 

22:00
Knockout with signalR then?
@LewsTherin Keep an eye on it, it might become amazing in the future. Who knows!
ok sir johan, have a nice nap
@RoelvanUden I will do that :P Thanks
I will try with a sample aspx, no razor, no mvc
@Darek Try ASP MVC 3
22:01
@Darek - Is it possible that you are not waiting for the connection to be opened?
it is
@LewsTherin You can do that, yeah. I actually did something similar. It's v. eay.
easy*
mvc 4 :)
MVC 4 looks like more stuff added to it :(
Frigging Microsoft
Works in a simple HTML
22:03
@RoelvanUden Ok I will defo try that. The more js the better ;)
its cleaner lews
@E.LDunn It's scary.. :D
@LewsTherin socket.io (basically SignalR in Node) with Knockout
Quite powerful.
haha, don't be scared
22:05
@RoelvanUden So that's Knockout + Node, right? I thought signalR abstracts socket.io?
and just so every one knows signalR ( at least as far as I am aware ) doesn't work in medium trust enviroments
@LewsTherin Nah, socket.io is the NodeJS equivalent of SignalR
(Truthfully socket.io is a lot easier, SignalR is a royal pain in the ... behind)
Right.. so socket.io acts as $.connection
Pretty much. The socket.io server has hubs, just like SignalR. The client part has $.connection equivelents.
@RoelvanUden Really? From the guys speech you would think that SignalR was the next best thing :D
22:06
Isn't it?
I don't know
@LewsTherin Yeah.. it's Microsoft. They say that about their equivalents of all products.
I made my own socket using an iframe and a async taskfactory
For the .NET world, SignalR is amazing.
@RoelvanUden Lol, true that
22:07
But it's not something unique to .NET.
@E.LDunn :( Any ideas why?
@TravisJ Reinventing the wheel much? :P
Ok, so I will use knockout + node.. pure JS
I hope I don't fail this assignment ha
what I like about SignalR is that it will pick up the best communication channel
@LewsTherin Haha. Gotta love node.
I cant remember, I basically made a whole system with it ... only to find when it was deployed it didn't work ( I thought it was worth a warning )
@Darek True that
22:08
@LewsTherin socket.io does the same on the Node world ... :-)
so how do I stuff my ticker into a template?
@RoelvanUden I dread finding the suitable libraries to install though
@LewsTherin npm install socket.io
@E.LDunn I'm avoiding it now anyway :P
@LewsTherin Shall I send you a chat server we had to make for Uni? :P
22:09
@RoelvanUden Is that a Vs command?
Nuget package manager?
don't get me wrong though it was lovely coding for it
npm is node package manager, but nice try :P
@RoelvanUden If you please :P
@RoelvanUden Ah. lol :D
Shall I remove the mongodb persistent logging?
Mongodb.. I might use that as well.. No :D
22:10
Ok then you just need it running on your system for this example
I just learnt a very important lesson while doing it , know your deployment enviroment
@E.LDunn Maybe it works for .NET 4.0?
Is it possible that Node is less of a pain than Ruby? I think it is because I know a bit of javascript
Of course at that precise moment my web server goes down.
Oh it.. happens :(
22:12
Fudge ... Signal R works in HTML but refuses to work in cshtml
@Darek That is confusing rofl :P Can we the .cshtml file?
@{
    ViewBag.Title = "Home Page";
}

<h2>@ViewBag.Message</h2>
<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</p>

<p>
    To learn more about working with the Telerik Extensions for ASP.NET MVC, you can visit the folowing resources:
</p>
<ul>
    <li><a href="http://demos.telerik.com/aspnet-mvc/">online demos</a></li>
    <li><a href="http://www.telerik.com/help/aspnet-mvc/introduction.html">online documentation</a></li>
@RoelvanUden How do I run it again?
same error, connection is undefined
@LewsTherin You just need mongodb running and then node app to start the server. Then go to localhost:8080 and follow the instructions. Note that there is a bug, it emits messages in the wrong way from history, but teach didn't notice so it was OK.
22:14
but this works fine:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script src="/Scripts/jquery-1.9.1.min.js" > </script>
        <script src="/Scripts/json2.min.js" > </script>
        <script src="/Scripts/jquery.signalR-1.0.1.min.js"> </script>
        <script src="/signalr/hubs"> </script>
        <script type="text/javascript">
            $(function () {
                // Declare a proxy to reference the hub.
                var ticker = $.connection.tickerHub;
                // Create a function that the hub can call to broadcast messages.
2
Q: How do I make SignalR work inside _Layout.cshtml?

Duncan McIntyreI'm working on an MVC3 project right now and just started using SignalR. I have followed several demos but I can't seem to get it working when my codes are inside \Views\Shared_Layout.cshtml. I always get the "Connection must be started before data can be sent." error. Please see my codes below...

trying this
@RoelvanUden I have to install mongo but I will tell you if I get it running
It should work fine. Let me know if there are bits you don't understand, and please, don't see this as some kind of holy grail. It's just something quick I threw together to get out of class.
Oh.. my. There are many bits I don't grok :D
Your JS is very neat though, nice!
don't ask me to many technical questions @LewsTherin Im a little wasted, but while we are on web stuff, has anyone done much stuff with breeze.js
Nope I haven't :(
22:18
It looks good..
.. It looks a little C#-inspired though.
I only ask as I work with mobile apps and its a 50 50 chance a mobile device wont have web access.. I have heard breeze is an upshot alternative
Bookmarked it. I'll have a look at some point, it looks cool.
How do I start mongo again?
Double-click mongod.exe
@Darek Did it work?
22:24
Nope
@RoelvanUden
it works in HTML
but in CSHTML fail
@RoelvanUden Uh, do you know the default installation directly for npm - of course you do..
@Darek Can you pastebin the entire CSHTML
user142019
MongoDB is web scale.
@Darek So you are using a partial to store your signalr includes right?
@LewsTherin It gets added to PATH, just restart your cmd prompt to let it take effect :P
22:25
@LewsTherin hmm. ... partial?
Nope.. not working
@LewsTherin But.. C:\Program Files\nodejs
@Darek Layout.cshtml
Yes
i.e
Index.cshtml
@{
    this.ViewBag.Title = "Home Page";
}

<h2>@this.ViewBag.Message</h2>
<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</p>

<p>
    To learn more about working with the Telerik Extensions for ASP.NET MVC, you can visit the folowing resources:
</p>
<ul>
    <li><a href="http://demos.telerik.com/aspnet-mvc/">online demos</a></li>
    <li><a href="http://www.telerik.com/help/aspnet-mvc/introduction.html">online documentation</a></li>
Index.cshtml is your partial? In that case you need to reference it
Layout="~/Views/Shared/Index.cshtml";
22:26
and the damn thing works fine in html
exact code
@Darek /Scripts/jquery-1.9.1.min.js?
Shouldn't Razor be using @Url(~) bollox?
upgraded
I don;t know, not an expert in Razor
what woudl be the form?
just one sample
@RoelvanUden you don't need to use it, but it's nice to use the URL helpers
@Pheonixblade9 Ah, 'kay.
@Darek <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.signalR.js")"></script>
I am good with samples
22:28
I copied that from the answer you linked.
I can't find mongod in node dir.. I am checking node_modules right now though
@LewsTherin Well, I blame that on the time, because that was incredibly stupid.
@LewsTherin mongodb.org :)
Node != MongoDB
should I leave /signalr/hubs alone or also convert it to @url?
@RoelvanUden Rofl, I have installed it using npm
That's why I was asking npm installation dir
connection still undefined
22:30
@LewsTherin Damn, I'm the one being incredibly stupid.
@Darek Where is index.cshtml?
@Darek What version of ASP.net/MVC?
@LewsTherin Unless.. you expect MongoDB to be installed, but you installed the driver instead.
MVC 4 with Telerik stuff on top
And you don't need the driver, it's already included in the zip I gave you.
Also, npm install always installs in your current directory.
22:31
Are you not using the bundle helpers?
Index.cshtml is in Views/Home/
Whatever that is, unless you specify -g for gloal
@RoelvanUden I installed both mongodb and mongoose.. I expect one should include mongod?
@LewsTherin C:\mongodb\bin\mongod.exe
@Darek If that contains the script files you have to include it in your ticker page
22:32
@LewsTherin mongoose will already contain mongodb driver.
Ok I definitely need to read the specs better
I think I know where it installed mongo
@RoelvanUden Looks like I am downloading the correct stuff this time :D
Looking at the knockout tutorial, I suspect I need a good sleep before attempting it
@LewsTherin is _layout.cshtml a "master page"
It's similar yeah
so if my generated header looks like this:
<!DOCTYPE html>
<html>
    <head>
        <script src="/Scripts/jquery-1.9.1.min.js" > </script>
        <script src="/Scripts/json2.min.js" > </script>
        <script src="/Scripts/jquery.signalR-1.0.1.min.js"> </script>
        <script src="/signalr/hubs"> </script>
@LewsTherin Wait to see something that you would not expect in JS? :-P
22:41
$.connection should be available?
@LewsTherin
@RoelvanUden That data-bind attribute is fecking amazing. Reminds me of WPF :D
A php dev and a c# dev walk into a bar... Thats all ive got so far, its a php project
@Darek So that's in your layout file?
@LewsTherin I am looking at the generated Home page
@LewsTherin It is a like WPF; Knockout facilitates the same principles as WPF :)
22:42
I've put the scripts in _layout
@LewsTherin I have this bit of code running in Node.. pastebin.com/FXCneNEJ :-D
@Darek So your Home.cshtml includes it fine then?
Yes
@RoelvanUden Wtf, is that C# and JS? Or JS has an await keyword?
but $.connection is undefined
22:44
Can you show snippets of home.cshtml file?
@LewsTherin I expected that reaction :-) This is a small language called CoffeeScript, which compiles to JavaScript. await/defer are keywords added by IcedCoffeeScript which makes JavaScript beautiful and without callback hell. :D
Frigging Telerik!!!!!
@RoelvanUden This seriously makes me jealous
@(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Combined(true).Compress(true)))
all hell break loose when this is present
Sheesh.. mongodb doesn't even offer an installation file, just binaries.. I hate that for some reason
22:47
@LewsTherin Haha.
me too lews
@Darek No idea what that does..
invetigating
if it is commented out, the connection shows up
Yay, mongo up and running
@RoelvanUden localhost:3000 right?
22:52
Oh that's cool
Does it create a db on the fly? I never did anything..
It does.
It does it in node right?
That is just the way mongodb operates, no schemas, no strict collections.
If you write to a collection, it just appears.
IIRC, a collection is akin to a table?
Or maybe that is a document :S
collection is a table, document is a row, field is a column
22:55
Makes sense.. time to write some KO + Node & Mongo
Yes!!
I did it!
It's alive!
:P
@LewsTherin
Congrats!
Congratulations! What was the issue?
I head to stick it in the header of layout.cshtml
OOps
no
sorry
If this line is present
@*@(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Combined(true).Compress(true)))*@
it will still fail
L(
without the comment of course
And that line doesn't throw an exception?
23:01
Nope
but it does modify JavaScripts
when making a custom control. Why do the margins change instead of the width and height of the Control?
I will trying adding my scripts to said group
user1125394
what does return GetDateTime when the value is NULL?
user1125394
(MysqlDataReader
what do you mean c'c
as in the value in sql is null?
user1125394
23:04
yes
@LewsTherin and @RoelvanUden adding scriots worked
@this.Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Add("/Scripts/jquery-1.9.1.min.js").Add("~/Scripts/json2.min.js").Add("~/Scripts/jquery.signalR-1.0.1.min.js").Add("/SignalR/hubs").Combined(true).Compress(true))
user1125394
seems we must call IsDBNull(i) first
@Darek Glad you got it working.. can be a real pain :(
But now tMenu does not exist (a Telerik thing I think)
yes c'c although I don't know how ef and many other orms deal with it
user1125394
23:06
ok, that sucks a lot
Goodnight lads... going to get some needed sleep. Ciao
night @lews
no lews
come back
No.... we shall meet again E.L <3
No rest for the wicked.
23:09
@CCInc Haha bye @P
@RoelvanUden Me not wicked! And with that//
no rest for the people getting drunk and trying to find some normal convo on the interwebs either
Hehe, good luck with that @E.LDunn :D
I'm off too, night.
lol night night roel have a good one
night roel
Thanks, see y'all later.
23:26
It seems I am not the only one having issues with Telerik @LewsTherin
23:57
keepin it alive
:)

« first day (909 days earlier)      last day (4265 days later) »