MVC

Neo4j.AspNet.Identity is Back!

In fairness, it was never *away*, but after a brief hiatus - it is being developed again. So changes – it’s moved - https://github.com/cskardon... It’s also been repackaged and nuget-ed, the instructions on the Readme have been updated and the actual database structure is better than before, it’s not all there (of course) but I will accept pull requests and any issues, open up on the github page. I’ll try to do some follow up posts with the db structure, but roughly: ......

CdnFallbackExpression for JQuery, JQuery.UI, Modernizr and Bootstrap

So, like a total chump, I didn’t really understand what the CdnFallbackExpression on a Bundle actually meant. It didn’t help that pretty much every example you find online shows you what to write for jQuery, but nothing else. With Tournr, I want to use CDN’s where I can for obvious reasons – and so I dutifully tried the jQuery example: var bundle = new Bundle("~/Scripts/jQuery").... bundle.CdnFallbackExpression = "window.jQuery"; bundle.CdnPath = "https://ajax.aspnetcdn.com... ......

Ninjecting Neo4jClient into MVC5/4/3

First, create your new MVC project (or load your existing one!) Then add the Ninject.MVC nuget package: We’ll also want the Neo4jClient package Now we have those two, we can hook it up, first off we need to tell Ninject how to bind to Neo4jClient, I use a Module for this, so add this class to your project (usually I have them in a sub-folder called ‘Modules’ in the App_Start folder – but it can be anywhere):public class Neo4jModule : NinjectModule { /// <summary>Loads the module into the kernel.</summary> ......

Gotcha Got with AzureReader2 and ImageResizer

After my previous post on getting AzureReader2 up and running with ImageResizer – I ran into a problem – I had a page with a foreach on it, where I had a link to each fullsize image. It was all working fine, except for a couple which just wouldn’t work. <a href="/cloud/blah-1/example... src="/cloud/blah-1/example.... /></a> <a href="/cloud/blah-2/hello%2... src="/cloud/blah-2/Hello%20... ......

Registering…

So, I want potential clients to have to enter the least amount of info possible to get an account, to that end, I really don’t see the benefit of a username and email address, I’d rather just use the email address. Pretty easy, edit the Register.cshtml to remove all traces of a ‘username’ field… Edit the controller so that it now reads: model.UserName = model.Email; if (ModelState.IsValid) { /*...*/ } F5 and … no Hmmm, turns out the ModelState isn’t valid, and that’s down to the fact that I’ve left ......

Ajaxy

Today is the big day, the day I attempt to use Ajax in the app… I’ve never done this (well, tell a lie, I’ve done it in a ‘tutorial’ site, but that was a while ago now), so it’s going to be interesting.. OK, basics first, let’s start with the @Ajax.ActionLink Right, first stab: @Ajax.ActionLink("Click to get latest", "LatestEntry", new AjaxOptions { UpdateTargetId = "ajaxEntrant", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" }) As far as I’m aware, I’m asking to get the ‘LatestEntry’ ......

MVC–Hooking up my randomizer

Structurally, I have 3 projects, the site, the EF database and the randomizer. The randomizer uses entities from the EF database, so all is good on that front. So, first cut, add a method to my Controller called Randomize, which takes in one of the EF entities: public ActionResult Randomize(TableB tableB) { /*...*/ } I’ve even given it an [HttpPost] attribute, now, I’m not anyway sure this is right, time will tell right? Anyhews, simple method: [HttpPost] public ActionResult Randomize(TableB tableB) ......

MVC–Day 2(or 3/4ish, maybe more)

So, my excursion in the web world continues… One of the issues I have coming from silverlight / wpf is that I’m very used to the XAML, MVVM approach to developing, I can knock up a passable interface in XAML in very little time (note, I didn’t say a good interface), but I really don’t know how to do this in CSS.. OK, not totally true, I have a rough guess, I have played with things like Firebug, and modified existing css in the past, but the problem with that, is that I’m just tinkering. With this ......