Bas Geertsema.net

Why writing more HTML markup is not an issue

by bas 1/7/2008 11:24:40 AM

The coming of the asp.net MVC framework had me thinking about the nature of markup and specifically the difference between the way ASP.NET Webforms handles this and the new ASP.NET MVC framework. I have not really used it yet, but when you come across MVC examples there is no doubt that the feel and look reminds you of the classic ASP style of writing markup: a lot of intermixing between markup and code and logic handling inside templates.  Values are inserted with asp.net tags instead of in the code behind. Compared to the use of webform controls this might seem like more cumbersome work. But when I look at the efforts I actually spent at writing the HTML markup it turns out to be only a small part in the total project. For the interface functionality, a lot of my efforts go into making sure the layout and functionality of the website comes across multiple browsers in a uniform manner. I sketched a diagram which will make it more clear:

markup-600

 

 

So actually I like it that the MVC gives you more control over the  generated markup, since it will hopefully decrease my efforts to develop cross-browser compatibility (sigh) and create more lean-and-mean pages. There are already many helper functions available that can conveniently generate often-used html markup, such as internal links (action links) and textboxes. I am sure that we will see more 3rd party controls and utilities that allow you to generate more complex HTML (such as a treeview), but with more fine-grained control over the generated output and still hiding/covering the hard parts such as ensuring cross-browser compatibility.

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Professional

Related posts

Comments

1/19/2008 12:19:38 AM

Ivo

Hi Bas, You stated "So actually I like it that the MVC gives you more control over the generated markup, since it will hopefully decrease my efforts to develop cross-browser compatibility (sigh) and create more lean-and-mean pages.".

In my opinion, the MVC model gives clean and proper guidelines to seperate the logic (or Model) from the View and Controller. When you do this in a neat way, you still have to test and test and test your websites to create cross-browser compatible pages. It doesn't necessarily decrease the time to create these cross-browser compatible pages. However, it will allow you to create neater pages that are better to test and modify which leads to a decrease in development time.

What do you think about my opinion?

Ivo nl

1/20/2008 11:40:42 AM

Bas

Hi Ivo. Note that I was refering to the difference between ASP.NET webforms and the MVC model. The server controls in WebForms abstract a lot of html from you, since they do their own rendering. In some cases, they hide too much details from you which creates HTML that does not fit within the rest of your page (HTML/css wise). That was my point. I agree with you that MVC is a good pattern, seperation of concerns and high cohesion are always good rules of thumb. This was also already possible in asp.net WebForms, as long as you do not put too much (business) logic in your .aspx or codebehind and refactor this out to seperate classes. The new MVC model just makes it more fluent and easier to design it that way.

Take this post lightly, I just tried to dismiss the myth that writing HTML markup manually is always a bad thing Wink

Bas

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

1/6/2009 3:49:26 AM

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

Search


Feed

RSS comment feed Subscribe to RSS feed (informs you when there is a new writing)

Recent posts

Recent comments

Tags