Blog - Microsoft .NET, ASP.NET, AJAX and more

How To: Adding MVC items to an ASP.NET Web Application

by Damien White 5/20/2009 9:30:10 AM

HTML Code I’ve been experimenting with using ASP.NET MVC inside a standard ASP.NET Web Application (Web Forms).  I really like what’s been released with MVC 1.0 and can see places where existing apps would benefit from the features.  Plus, having just finished Professional ASP.NET MVC 1.0 from Wrox (see my book review), I couldn’t wait to start using it. 

The last chapter of the book, Chapter 12, entitled “Best of Both Worlds: Web Forms and MVC Together,” discusses configuring an ASP.NET Web Application to support the new ASP.NET MVC features.  Note that adding Web Forms to an ASP.NET MVC project template is much easier (meaning no configuration/reference changes), since ASP.NET MVC is built on top of the ASP.NET Framework.  Anyway, after referencing the required libraries, creating the necessary directories, and updating the web.config, you’ll find that templates for the MVC items (e.g. Controllers, Views), are missing as options.  More...

Shout it kick it on DotNetKicks.com Bookmark and Share

Book Review - Wrox Professional ASP.NET MVC 1.0

by Damien White 5/17/2009 12:01:58 PM

Professional ASP.NET MVC 1.0Working primarily on web applications, I’ve focused most of my time on ASP.NET Web Forms since the very early betas.  Web Forms were truly a great revolution in the web world.  Once I saw the functionality when it first came out (when I was using ::shudder::  “classic” ASP), I couldn’t wait to start using it.  I began right away with ASP+, as it was called back in 2000, abandoning Visual Interdev and ASP, yippee.  The release of Version 1.0 came out January 16, 2002, changing the way we work with the web.

Flash-forward 7 years (9 from the early betas), and the programming world has changed.  With things like TDD (Test Driven Development), AJAX, JSON, jQuery, etc, and the complexity of web applications growing, sometimes Web Forms would get in the way.  To be fair, the Web Form framework is very robust and tries to be helpful, but sometimes we developers like to shoot ourselves in the foot.  One example that I’m sure many of you have experienced is trying to interface with a server-rendered element on the page.  Performing something like a document.getElementById(‘UserName’) in JavaScript doesn’t exactly work as expected when the ID of your textbox is now something along the lines of “ctl00_mainContent_LoginCtrl_UserName,” does it?  On this particular topic, ASP.NET 4.0 has a solution for this problem, but that isn’t the focus of this post.  The Client Id problem, is just one example of the framework “getting in your way.”  This is one of the many reasons behind the advent of ASP.NET MVC.  Having just finished Professional ASP.NET MVC 1.0 from Wrox, I’m a convert. More...

Shout it kick it on DotNetKicks.com Bookmark and Share
Tags: , ,
Categories: .NET | ASP.NET | MVC | Review
Actions: E-mail | Permalink | Comments (5) | Comment RSSRSS comment feed