Tutorial by Examples

When user enters an URL, for example: http://example-website.com/Example/HelloWorld, MVC application will use the routing rules to parse this url and extract the subpath, that will determine the controller, action and possible parameters. For the above url, the result will be /Example/HelloWorld, wh...
If there would be another value in the URL like: /Example/ProcessInput/2, the routing rules will threat the last number as a parameter passed into the action ProcessInput of controller Example. public ActionResult ProcessInput(int number) { ViewData["OutputMessage"] = string.format(...
We can call an action result in another action result. public ActionResult Action1() { ViewData["OutputMessage"] = "Hello World"; return RedirectToAction("Action2","ControllerName"); //this will go to second action; } public ActionResult...

Page 1 of 1