Welcome URL
/HelloWorld/Welcome?name=Scott&numtimes=4) C#
URL numtimes 1
public string Welcome(string name,int numTimes=1)
{
return HttpUtility.HtmlEncode("Hello " + name + ",NumTimes is:" + numTimes);
}
http://localhost:xxxx/HelloWorld/Welcome?name=Scott&numtimes=4
2-6 URL Welcome
2-6 Welcome
MVC VC HTML
HTML
HTML ASP.NET
MVC3
ASP.NET MVC3 -
3.1
HelloWorldController HTML
ASP.NET MVC3 Razor Razor .cshtml,
HTML Razor
HelloWorldController Index Index
public ActionResult Index()
{
return View();
}