using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Your_Web_Application_Name.Controllers { public class HomeController : Controller { // GET: Home public string Index() { return "Hello MVC 5 Application"; } } }
http://localhost:xxxx
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Your_Web_Application_Name.Controllers { public class HomeController : Controller { // GET: Home public string Index (string id,string name) { return "The value of Id = " + id + " and Name = " + name; } } }
https://localhost:44300/Home/index/23?name=AIT
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Enter_Your_Webapplication_Name.Controllers { public class HomeController : Controller { public string Index(string id, string name) { return "Id = " + id + " , Name = " + Request.QueryString["name"]; } } }
https://localhost:44300/Home/Index/23?name=AITAcadmy