Well we’ve arrived at the last part of our series on ASP.NET MVC. In this post we’ll be looking at Views, ViewData, and HTML Helpers. We’ll be discussing how to call Views from Controllers and how to use HTML Helpers to create your markup.
Suppose we receive the following request; http://yourdomain.com/Task/Show/23. The request would map to the following controller.
1: public class TaskController : Controller
2: {
3: public ActionResult Show()
4: {
5: return View();
6: }
7: }
Today’s article is going to be one of many, or at least a few, that take a look at building an application using the new ASP.Net MVC Beta. I wanted to do this in a small series so we can look at each phase of the application in a decent amount of detail while keeping the length appropriate for a blog post.
This first part isn’t actually going to crack the lid on MVC just yet but we are going to look at a few things today.
This is a simple hello world example with ASP.NET MVC, to help you build your first application step by step. I will not explain the ASP.NET MVC here, you can find plenty of excellent resources on the web for that, you can try one of these: Kigg - Building a Digg Clone with ASP.NET MVC, ASP.NET MVC Framework, An Architectural View of the ASP.NET MVC Framework . We’ll create a web application with two additional views - the first will ask for your name, and when you submit it you’ll get a greeting message in the 2nd view. Lets start:
1. Download and install ASP.NET MVC Preview 3.
2. Create a new ASP.NET MVC Web Application, Call it MVCHelloWorld
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More