MVC or Web Forms? A Dying Question

 

Everyone who talks about ASP.NET MVC gets asked the question:

    Should I use MVC or Web Forms?

There’s been quite a bit of debate on this topic, but in a couple years I don’t think it will matter.

twin cars

and the stories continues here MVC or Web Forms? A Dying Question until …

spectrum

The question in the next decade won’t be: “MVC or Web Forms?”.

The question will be: “MVC or SharePoint?

But nobody will ask the question, because the answer is easier to figure out.

:>

Facebook Developer Toolkit 3.0 – ASP.NET MVC Sample

 

Facebook Developer Toolkit 3.0 – ASP.NET MVC Sample

It’s almost time for the long awaited release of the Facebook Developer Toolkit 3.0, the most awesomest release of the toolkit to date. The new version has great support for ASP.NET, ASP.NET MVC, Silverlight, WinForms, WPF and basically any place you can run .NET.

image

Facebook Developer Toolkit 3.0 – ASP.NET MVC Sample – Kevin Marshall’s Epic Work Blog for Awesome People

Labs of ASP.NET MVC Training Kit

 

Labs

Introduction to ASP.NET MVC
This hands-on-lab will introduce you to developing web applications with ASP.NET MVC and teach you the basic conventions and features contained within it. It will also show you how to unit test your custom controllers as well as your application’s route definitions.

Setup Lab Manual (html | docx)     Source Files

Enhancing Asp.NET MVC Applications
This hands-on-lab will show you how to deal with some additional common requirements that occur when developing application with ASP.NET MVC. This includes: handling form posting/validation, model binders, partial views, and action filters.

Setup Lab Manual (html | docx)     Source Files

ASP.NET MVC Training Kit – ASP.NET MVC

MVC, MVP, MVVM Design Patterns

 

1. The 1st half of this article will compare and contrast MVC, MVP, and MVVM, and suggest which pattern to use based on your technology of choice and the problem that you are trying to solve. The 2nd half will be an overview about how MVVM could be used in Silverlight.

 

 

Read more here -> CodeProject: Model View Controller, Model View Presenter, and Model View ViewModel Design Patterns. Free source code and programming help

2. Model-View-ViewModel (better known by its super hero alias of MVVM ) is a great pattern to use with Silverlight and WPF. Here is a 5 minute perspective on MVVM.

Why?

1 reason MVVM works really well with XAML based applications is because of the powerful XAML binding features. This allows the View (the presentation of to the user) to be separated from the data and the logic. The View can be designed in Expression Blend while the ViewModel can be developed in Visual Studio .NET. It allows for the presentation to be separated very easily. This is just 1 reason, albeit a powerful one.

image

Read more here –> http://johnpapa.net/silverlight/5-minute-overview-of-mvvm-in-silverlight/

Integrating OpenID / OAuth in an ASP.NET MVC Application using DotNetOpenAuth

 

image

How to implement OpenId for authentication rather than the custom username/password login that’s been in use up until now. OpenId is a centralized login/authentication mechanism which handles authentication through one or more centralized OpenId providers. These providers live on the Web and are accessed through a forwarding and callback mechanism – you log in at the provider’s site and are then returned to the original starting Url with an authorized user token that uniquely identifies that user to the original site.

Via Integrating OpenID in an ASP.NET MVC Application using DotNetOpenAuth – Rick Strahl’s Web Log

Microsoft Ajax CDN and the jQuery Validation Library

Scott Guthrie announced the launch of the Microsoft Ajax CDN on his blog last night. If you have not read his post, I recommend that you read it now to get a general overview of the CDN and how you can take advantage of the CDN to improve the performance of your ASP.NET Web Forms and ASP.NET MVC applications:

http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx

“The Microsoft Ajax CDN enables you to significantly improve the performance of ASP.NET Web Forms and ASP.NET MVC applications that use ASP.NET AJAX or jQuery.  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.

ASP.NET 4.0 will make it especially easy for ASP.NET Web Forms developers to take advantage of the CDN. By setting one property of the ScriptManager control – EnableCdn=true, you will be able to redirect all requests for the built-in ASP.NET JavaScript files to the CDN and improve the performance of your Web Forms applications.”

In his announcement, Scott describes how both the ASP.NET Ajax and the jQuery libraries are included in the CDN. There is one more set of JavaScript files that are added to the CDN today that Scott did not announce: the jQuery Validation library.

If you are not familiar with the jQuery Validation library then you should know that this is one of the most popular form validation libraries used by jQuery developers. Microsoft is shipping the jQuery validation library with both ASP.NET Web Forms and ASP.NET MVC in Visual Studio 2010.  Furthermore, jQuery Validation library will be integrated with ASP.NET MVC.

Via Microsoft Ajax CDN and the jQuery Validation Library

Put Your Views (and Pages) On a Diet using web.config

 

The default view engine and Pages is that there’s all this extra cruft in there with the whole page directive and stuff. But it turns out that you can get rid of a lot of it. Credit goes to David Ebbo, the oracle of all hidden gems within the inner workings of ASP.NET.

First, let me show you what the before and after of our default Index view.

Before
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
    </p>
</asp:Content>
After
<asp:Content ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
    </p>
</asp:Content>

For more goto Put Your Views (and Pages) On a Diet

A WCF RESTful service using ASP.NET MVC using REST MVC SDK

Hybrid choice that blends ASP.NET and WCF. The WCF team saw that many developers building ASP.NET MVC apps are more comfortable with the ASP.NET MVC programming model, but still want to supply more rich RESTful services from their web applications. So the WCF team put together an SDK and samples for building REST services using ASP.NET MVC.

You can download the samples and SDK from ASP.NET MVC 1.0 page on CodePlex.

Do read through the overview document as it describes the changes you’ll need to make to an application to make use of this framework. Also, the zip file includes several sample movie applications which demonstrate various scenarios and compares them to the baseline of not using the REST approach.

Via Rest For ASP.NET MVC SDK and Sample