Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



LearnNow


XAMALOT
 


SSWUG

Reader rating:
Click here to read 2 comments about this article.
Article source: CoDe (2010 Mar/Apr)


Article Pages:  1  2 3 4 5 - Next >


Supercharging ASP.NET MVC with MvcContrib

Hot on the heels of the groundbreaking release of ASP.NET MVC CTP 1 in December of 2007, an open source project called MvcContrib came to life. MvcContrib has enjoyed tens of thousands of downloads since it started in December of 2007. In this article, I will explain MvcContrib; it’s major components, how to use it, and how to get involved in its continued development.

MvcContrib from 30,000 Feet

MvcContrib is a .NET 3.5 SP1 library that provides extensions for use with Microsoft’s ASP.NET MVC Framework. MvcContrib does not provide replacements for parts of ASP.NET MVC. Rather it includes features and components that compliment and extend ASP.NET MVC. The MVC Framework provides many extension points, and MvcContrib leverages many of them. From controller factories to grid components to view automation helpers, MvcContrib is the first place you should look for the extras to make your MVC applications great.

MvcContrib is the first and oldest open source project based on ASP.NET MVC. Based on the stats at CodePlex, it may also be the most popular community-based library for the ASP.NET MVC Framework. Figure 1 shows the stats widget from the project site at http://mvccontrib.org.

Click for a larger version of this image.

Figure 1: MvcContrib has many downloads.

In preparation for this article, I also did some quick search engine analysis to see how many pages, blog posts, articles and the like are talking about MvcContrib. I did time-bounded searches and came up with the following chart in Figure 2 that shows the trend of MvcContrib community growth. You can see now that there are around 90,000 web pages on the Internet that mention MvcContrib.

Click for a larger version of this image.

Figure 2: The MvcContrib community has grown many times over.

Before going further, it is important to have some basic information about the MvcContrib project. Table 1 gives overview information.

MvcContrib has kept pace with the latest releases of ASP.NET MVC. At press time, MvcContrib builds against ASP.NET MVC 2 RC, although you can still download previous builds that are built against ASP.NET MVC 1 from http://mvccontrib.org. I covered MvcContrib in my book, ASP.NET MVC in Action, published by Manning Publications Co. You can find out more at http://mvcbook.jeffreypalermo.com/.

The CodePlex Foundation has received an application from MvcContrib requesting acceptance into the ASP.NET gallery. By the time you are reading this article, the result of that application will likely be known.

Throughout the rest of this article, I will walk through the high points of MvcContrib and demonstrate some of the key features that you don’t want to miss. I’ll start by showing you how to obtain and use MvcContrib. Then I’ll walk through the major features contained in the library and show samples. Then I’ll dive into the source and find out how to get involved with the continued development of MvcContrib.

How to Get and Use MvcContrib

The first step to using MvcContrib is to download the latest release. Go to http://mvccontrib.org and click the download button on the CodePlex project site. Look for a distribution file called MVCContrib.release.zip. Download it and extract it locally. Then create a new ASP.NET MVC project and add a project reference to MvcContrib.dll as shown in Figure 3. There is also a zip file called “extras”. This file is much larger and contains the features that are by nature coupled to larger dependencies, like controller factories and view engines.

Click for a larger version of this image.

Figure 3: MvcContrib added as a project reference.

I will run through a very quick example of using the MvcContrib grid as well as ViewDataExtensions. The example display some of the type members in a grid. Figure 4 shows the page I’ll show you how to create.

Click for a larger version of this image.

Figure 4: The MvcContrib grid makes it very easy to format tabular data.

This example needs a listing of MemberInfo objects and a grid with columns “Member Type”, “Name”, and “Declaring Type”. The first bit of code I need to write is a short snippet in the Index action of the HomeController.

public ActionResult Index()
{
IOrderedEnumerable<MemberInfo> members
from MemberInfo m 
in GetType().GetMembers()
orderby m.Name ascending
select m;

ViewData.Add(members);
ViewData["Message"] 
= "Welcome to ASP.NET MVC!";
return View();
}

I slipped in some usage of the MvcContrib ViewDataExtensions here by using the single-parameter Add() method. This extension uses the object type as the dictionary key. This is very useful when you only have one object of a certain type in view data, and you are not using polymorphism between the controller and view. Next, in the view, I will add a small snippet to the default Index.aspx page as follows:

<%=Html.Grid( 
   ViewData.Get<IOrderedEnumerable<MemberInfo>>())
    .Columns(column =>
    {
         column.For(x => x.MemberType);
         column.For(x => x.Name);
         column.For(x => x.DeclaringType);
    })%>

That’s it! Hit CTRL+F5 to run the project without debugging, and you will see a screen similar to Figure 3.

Now that you’ve already seen how to start using MvcContrib, I will move into a more detailed walkthrough of the major MvcContrib features.

&

By: Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. His company specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is a MCSD.NET , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&amp;M University graduate.

Headspring Systems is available for consulting. We can coach your software team or deliver custom software quickly to match your needs. We specialize in software architecture and design, technical coaching, software management coaching, software business analysis, business leadership, technical recruiting, C#, .NET, agile, lean, extreme programming, and scrum.

code@palermo.cc



Table 1: MvcContrib overview.
Project URL:http://mvccontrib.org
Source:http://github.com/mvccontrib
VCS:GIT
Founders:Jeffrey Palermo & Eric Hexter
Lead Committer:Jeremy Skinner
License:Apache 2.0
Fx version:3.5 SP1 MVC 2 RC (at press time)
#Unit Tests:1058
Build Server:http://teamcity.codebetter.com
Email List:http://groups.google.com/group/mvccontrib-discuss


Article Pages:  1  2 3 4 5 - Next Page: 'Major Feature Tour' >>

Page 1: Supercharging ASP.NET MVC with MvcContrib
Page 2: Major Feature Tour
Page 3: Input Builders
Page 4: Portable Areas
Page 5: Working with the MvcContrib Source

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
1.7 out of 5

52 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      Sharepoint TechCon

 

Sharepoint TechCon