Tutorial by Examples

This ActionResult returns a Razor view page. Under the standard routing template this ActionResult method would be reached at http://localhost/about/me The View will be looked for automatically in your site at ~/Views/About/Me.cshtml public class AboutController : Controller { public ActionR...
An ActionResult can return FileContentResult by specifying file path and file type based from extension definition, known as MIME type. The MIME type can be set automatically depending on file type using GetMimeMapping method, or defined manually in proper format, e.g. "text/plain". Sinc...
Action result can return Json. 1.Returning Json to transmit json in ActionResult public class HomeController : Controller { public ActionResult HelloJson() { return Json(new {message1="Hello", message2 ="World"}); } } 2.Returning Content to transmit...

Page 1 of 1