So you have your form in MVC 4 and you want to post it to a Action on a controller. The form represents a class, let’s pretend this is a contact form and you have a a class that look like this: class ContactMessage { public string Name { get; set; } public string Phone { get; set; } public string Email { get; set; } public string Message { get; set; } } And your action, looks like this: [HttpPost] public ActionResult Kontakt( ContactModel message) { var mailer = new ContactMailer(); var msg = mailer.ContactMessage(message); msg.Send(); } Well, that...…
Mission: Build a drop dead simple CMS
I’m on a mission. Actually, I have an itch. I need a drop dead simple CMS. Not Wordpress, Not Umbraco. I don’t want to bend my frontend after how the CMS is architectured. I want to slam a backend on my frontend, if you know what I mean. So - I will build one. The mission is to build a add on backend, using ASP.NET MVC4. I imagine it being a nuget package that you install and then you can just access the dynamic content by calling ` @CMS.RenderContent(“WelcomeScreen”) ` in your views. …
Typescript 101: Basics, Types and Functions
This is the second article about TypeScript, you can read the first part here I’ve talked earlier about the Javascript superset language TypeScript. I want to share some of the basics with you. Unlike javascript, Typescript is typed. This is a huge deal. It will give you compiletime syntax and type checking. Also - just in case you missed it - TypeScript is just an improved version of Javascript. (Thats what superset implies). Valid Javascript is also valid Typescript, so if you have JS code now, you can just drop it into typescript and continue. When you compile Typescript, you...…
My take on a new "blogging" concept that's pretty good
I think “blogging” sucks. Well, that’s a counterintuitive statement to declare on a so called blog. But bare with me. The typical blog have posts, those posts contains information, perhaps about a “Today’s clothing”, or something somewhat more alluring, perhaps … perhaps useful information. A serious blogger will publish these posts at a steady rate, at least a couple times a week. I tried it. It didn’t suit me. And this is why: My ideas need to incubate### When I first tried to blog, with wordpress, I was fired up. This is it! Lets do it! I often thought “This...…
Trying out Typescript
I’m trying out the javascript superset language TypeScript. A Typed language that compiles to Javascript. It was invetend by some pretty smart people over at Microsoft but, it is maintained Open Source. That - is a very good thing™. So let’s get started. Why would you use typescript? So, lets begin with some of the challenges with writing javascript applications. If you are sloppy with the code, not using the revealing module pattern, or reavling prototype pattern - the code tends to turn to spaghetti code, being impossible to maintain. It’s not impossible to write good, maintainable Javascript. But Typescript...…
Building my own blog
It might seem obscure to build a blog from the ground up in the year of 2013. There is free and excellent alternatives as Wordpress, Tumblr, blogfornet, or other solutions driven by your posts on Twitter and Facebook. For me, the decision was kind of easy. I have an childish itch to build stuff. Most enjoyable is to build stuff that i have complete control over - stuff that becomes my world for a couple of hours. But the decision to build a blog originated from the words from another blogger. …