Asp.net MVC 4 Html帮助类 II

来源:互联网 发布:python爬虫是什么发展 编辑:程序博客网 时间:2024/04/30 17:09

Html Helpers

@Html.AntiForgeryToken

It generates a hidden form field (anti-forgery token) that is validated when the form is submitted.

它会产生一个隐藏的表单字段(防伪标记),提交表单时验证。

@Html.AttributeEncode

To convert the specified attribute value to an HTML-encoded string.

HTML编码的字符串转换成指定的属性值。

@Html.Encode

To convert the specified value to an HTML-encoded string.

HTML编码的字符串转换为指定的值。

@{ Html.EnableClientValidation(); }

To enables or disables client validation

要启用或禁用客户端验证

Html. EnableUnobtrusiveJavaScript

To enables or disables unobtrusive JavaScript.

要启用或禁用不显眼的JavaScript。

@Html.FormatValue

To format value

要格式化值

@Html.Raw

To return markup that is not HTML encoded.

要返回标记并非HTML编码。

@Html.Partial

To render a partial view into a string.

要渲染成一个字符串的局部视图。

@{Html.RenderPartial(..);}

writes directly to the response output stream instead of returning a string.

直接写入到响应输出流,而不是返回一个字符串。

@Html.Action

executes a separate controller action and returns as string

执行一个单独的控制器操作并返回作为字符串

Html.RenderAction

executes a separate controller action and render the result directly to the Response

执行一个单独的控制器动作,并呈现结果直接响应

原创粉丝点击