1.View方法 ActionResult解析:(抽象類)視圖結果 子類: ...
1.View方法
public ActionResult Index() { //完整路徑 return View("~/Areas/Admin/Views/Home/Index.cshtml"); }
ActionResult解析:(抽象類)視圖結果
子類:
System.Web.Mvc.ContentResult:ContentResult Controller.Content("") 向用戶輸出字元串,沒有多餘的文本 System.Web.Mvc.EmptyResult: 返回空內容,Controller沒有提供方法 System.Web.Mvc.FileResult(抽象): 返回一個文件,用於驗證碼 FileContentResult(子類): Controller.File(new byte[],""); e.g return new FileContentResult(new byte[1024],"image/jpeg"); FilePathResult(子類): Controller.File("",""); e.g return new FilePathResult("logo.jpg","image/jpeg"); FileStreamResult(子類):e.g return new FileStreamResult(new FileStream("logo.jpg",FileMode.Open),"image/jpeg") System.Web.Mvc.ViewResult: