基类:
ActionResultAction中返回文本内容。
在Controller中使用Content方法调用 ,有以下重载。
- protected internal ContentResult Content(string content);
- protected internal ContentResult Content(string content, string contentType);
- protected internal virtual ContentResult Content(string content, string contentType, Encoding contentEncoding);
public ActionResult Index(){
return Content(“one,two,three...”);
}
属性:
- Encoding ContentEncoding 设置编码类型
- string ContentType 传输类型
- object Data 传入的数据
如果要在Preview2之前的版本中使用Content请参考
Asp.net MVC Render及Redirect的扩展