October 2011 Entries

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 ......

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 ......

MVC3–The Beginning

OOook, those who know me, or have read my blog probably have a pretty good idea that I’m a silverlight, wpf, wcf, c#, xamly kinda guy. I’ve never really done anything webby, the closest I’ve gotten is doing a bit of backend stuff, well, times change, and quite frankly I wanted to do something new… soooo I’ve opted to go down the MVC route, for two main reasons – 1, I figured I may as well learn a good framework, 2, Matt Abbott told me that MVC lets you get dirty with HTML, and that’s one of the things ......