This is a repost that originally appeared on the Couchbase Blog: ASP.NET with NoSQL Workshop.
I delivered an ASP.NET with NoSQL workshop at the recent Indy.Code() conference in Indianapolis. I had a lot of fun at this conference, and I recommend you go next year. If you were unable to attend, don’t worry, because I’ve got the next best thing for you: all the material that I used in my workshop.
If you’d like to try it yourself, the ASP.NET with NoSQL Workshop materials are available on GitHub. Each part of the workshop contains a PPT and PDF file for you to follow along. Also, the "completed" version of each workshop is available.
You can also contact me at Twitter @mgroves.
J. Tower is answering all my burning questions about .NET and .NET Core
Want to be on the next episode? You can! All you need is the willingness to talk about something technical.
Hey, did you know that I'm a Microsoft MVP? As an MVP, sometimes Microsoft lets me do some cool stuff.
For instance, they let me write some blog posts about Couchbase with Windows and .NET for the MVP Award Program Blog! There are three total parts, and part 1 was just published.
I always want to thank fellow MVP Travis Smith for being the technical editor for these posts! He provided some great feedback, and he's an overall great guy!
I'm trying to familiarize myself with node.js, since it seems to be in use by a lot of Couchbase customers. I heard that Visual Studio code had some pretty good node.js support built in, so I decided to give it a shot.
I already had node and npm installed on my Windows machine. I don't remember why. If you aren't sure if you do, open up Powershell (or cmd) and try:
(If metaphors help you, I think of node as ASP.NET and I think of npm as NuGet)
The next easiest thing you can do is create a file with text editor, say "app.js". Put this into that file:
var msg = "Hello, world!"; console.log(msg);
Woo. Now back at the command line, type:
And guess what it will write out? If you guessed "Hello, world!" then give yourself 10 points.
I have a web page on domain A and, say, a Json endpoint on domain B. I would like domain A to make an Ajax request to domain B, but when I try that, I get an error message, as shown here:
Let's explore the jsonp option. Here's a similar request to the one above, except this time it's using jsonp.
It does not raise an error.
The way jsonp works is a little wacky, but the main thing you need to know is that you need to specify a callback function. jQuery handles this automatically on the client side. Here's how I handle it on the server side with ASP.NET MVC using the Mvc.Jsonp package.
Notice three things:
The benefit is that you can now do cross-domain scripting. So far the drawbacks seems to be that:
I'm giving it a shot on Ledger, and seems to be working fine so far.
Matthew D. Groves lives in Central Ohio. He works remotely, loves to code, and is a Microsoft MVP.