As we know MVC, gives Test Driven Development hence use this in a small application.
Step 1 : First Open Visual Stdio 2010>New> Project.
Step 2 : Chose ASP.NET MVC Web Application.
Step 3 : After that next step is to check the Radio Button TO test the development.
Step 4 : Now you can see the following items in your solution explorer.

Step 5 : Now the First step is to form
a path to the Controller, Model and Veiw in Global.asax file as shown in the Solution Explorer above
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
System.Web.Routing;
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
protected void Application_Start()
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"PacificShow", // Route name
"Pacific/{firstname}", // URL with parameters
new { // Parameter defaults
controller = "Pacific",
action = "Show",
firstname = ""
}
);
}
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
}
}
}
Step 6 :Now after manipulating the routing add Model Class by following the steps as shown below:
- Right Click on Model>add>new item>chose class from template
- Name the class and click on add button
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
namespace
MvcApplicationByPC.Models
{
public class
Pacific
{
public string
Firstname { get; set;
}
public string
Mcnid { get; set;
}
public string
Technology { get; set;
}
public string
Address { get; set;
}
}
}
Step 7 : Next step is to add Controller who route is mentioned in
the route map.
Step to add Controller
Right Click on Controller Folder>add Controller>name the Controller

Now work on Controller to the data:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
MvcApplicationByPC.Models;





Prashant ChaudharyPosted Dec 9, 2011, 5:17 AM
Your Welcome
thiru prakashPosted Dec 5, 2011, 11:30 PM
thanQ for submitting this article............... very useful for startups in asp.net mvc