ASP.NET: Leaping from Webforms to MVC

Ever since late 2007 (I think Thinking) I’ve been reading quite a bit on the ASP.NET MVC framework. Even did some playing around here and there but never got to use it on a project. Until last week that is. I’m now working on a website that’s built entirely on the ASP.NET MVC framework. And of course, working on a project things are just a tad different from playing around a bit.

So, what is it that makes working with the MVC Framework so much different from Webforms? Well, let’s just put a small list here of some of the things I ran into. Needless to say that this is not a complete list, nor is it intended to be…

Where are the servercontrols?

Well, errrr, they’re gone. You don’t have them. You’re writing good old HTML again yourself. Of course, the advantage here is that you gain a lot of control over the HTML of your website. But, of course, no Servercontrols means “no events”. You even need to pull a trick to make a DropDownList autopostback (more on that here)…

Only one <Form> in a page?

Alright, an advantage of the MVC Framework. Every now and then I tend to run into this situation where I need some part of a page to submit to a different URL. In ASP.NET you need to use javascript Nerd to change the Action of the Form before it’s submitted. Or at least, that’s one approach of numerous you could choose from…

In ASP.NET MVC you can easily have different forms on a single page. Love that partRed Lips.

More to come

… as I experience. I decided to post and update this one along the way.

Leave a Reply

Your email address will not be published. Required fields are marked *