Tuesday, 21 January 2014

Hello World Example in ASP.Net MVC


Controller
  •       Contains Action

Hello World Example in Asp.Net MVC 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication2.Controllers
{
    public class HelloWorldController : Controller
    {
        //
        // GET: /HelloWorld/


        public string Index()
        {
            return "This is Action and saying Hello World...";
        }

        // GET: /HelloWorld/Welcome
        public string Welcome()
        {
            return "This is the Welcome action method created by me";
        }
    }
}

Welcome is Action and HelloWorld is Controller

By default we have Index Action Method.

0 comments:

Post a Comment