@{ Layout = “…”}

To define layout page Equivalent to asp.NET master-page

要定义相当于ASP.Net母版页的页面布局

@model <StrongModelType>

To define strongly-typed model

要定义强类型的模型

@section <name> { }

To define named section

定义命名节

@RenderBody

Used in layout as a placeholder for view’s entire content.

用于布局视图的整个内容的占位符。

@RenderPage

Renders the content of one page within another page.

将内容呈现在一个页面内的另一页。

@RenderSection

In layout pages, renders the content of a named section.

在布局页面,呈现的内容已命名的节。

IsSectionDefined

Returns a value that indicates whether the specified section is defined in the page.

返回一个值,指示是否定义在页面中指定的部分。

DefineSection

To create named content sections in content page.

创建命名在内容页的内容部分。

@helper

To define a helper which create a reusable code snippet.

要定义一个帮手创建一个可重用的代码片段。

@functions

To define a function ( pure server-side methods)that can be reused within the view.

要定义一个视图内,可重复使用的功能(纯服务器端方法)。

@ViewBag.<myData>

Dynamic property, used to pass data between a Controller and a View

用于控制器和视图之间传递数据的动态特性

@ViewData[myData]

To pass data between a Controller and a View via special Dictionary class

通过特殊的Dictionary类的一个控制器和视图之间传递数据

@tempdata

To pass State Between Action Methods

要传递操作方法之间的状态

ActionFilterAttribute

Represents the base class for filter attributes.

代表筛选器属性的基类。

ActionMethodSelectorAttribute

Represents an attribute that is used to influence the selection of an action method.

表示一个特性,用于一个操作方法的选择产生影响。

ActionNameSelectorAttribute

Represents an attribute that affects the selection of an action method.

表示一个特性,影响一个操作方法的选择。

CustomModelBinderAttribute

It invokes a custom model binder.

它调用自定义模型绑定者。

FilterAttribute

base class for action and result filter attributes.

行动和结果筛选器特性的基类。

Html.ActionLink

输出: <a href=”..”…>..</a>

Html.BeginForm

输出: <form …>

Html.CheckBox

输出: <input type="checkbox" …/>

Html.DropDownList

输出: <select ..> .. </select>

Html.EndForm

输出: </form>

Html.Hidden

输出: <input type="hidden" ... />

Html.ListBox

输出: <select multiple …>…</select>

Html.Password

输出: <input type="password" … />

Html.RadioButton

输出: <input type="radio" .. />

Html.TextArea

输出: <textarea…>…</textarea>

Html.TextBox

输出: <input type="text" … />

Html.ValidationSummary

Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.

返回一个在ModelStateDictionary对象中的无序列表(ul元素)的验证消息。

Html.ValidationMessage

To display an error for a particular field in the ModelState dictionary

要显示一个错误的ModelState字典中的特定字段

Html.RouteLink

To generate a URL to a specific route

要生成一个URL到一个特定的路由

@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

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

MVC杂记的更多相关文章

  1. C# DateTime的11种构造函数 [Abp 源码分析]十五、自动审计记录 .Net 登陆的时候添加验证码 使用Topshelf开发Windows服务、记录日志 日常杂记——C#验证码 c#_生成图片式验证码 C# 利用SharpZipLib生成压缩包 Sql2012如何将远程服务器数据库及表、表结构、表数据导入本地数据库

    C# DateTime的11种构造函数   别的也不多说没直接贴代码 using System; using System.Collections.Generic; using System.Glob ...

  2. Asp.Net Mvc 使用WebUploader 多图片上传

    来博客园有一个月了,哈哈.在这里学到了很多东西.今天也来试着分享一下学到的东西.希望能和大家做朋友共同进步. 最近由于项目需要上传多张图片,对于我这只菜鸟来说,以前上传图片都是直接拖得控件啊,而且还是 ...

  3. .Net Core MVC 网站开发(Ninesky) 2.4、添加栏目与异步方法

    在2.3中完成依赖注入后,这次主要实现栏目的添加功能.按照前面思路栏目有三种类型,常规栏目即可以添加子栏目也可以选择是否添加内容,内容又可以分文章或其他类型,所以还要添加一个模块功能.这次主要实现栏目 ...

  4. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库

    在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...

  5. ASP.NET Core MVC/WebAPi 模型绑定探索

    前言 相信一直关注我的园友都知道,我写的博文都没有特别枯燥理论性的东西,主要是当每开启一门新的技术之旅时,刚开始就直接去看底层实现原理,第一会感觉索然无味,第二也不明白到底为何要这样做,所以只有当你用 ...

  6. ASP.NET Core 中文文档 第四章 MVC(3.8)视图中的依赖注入

    原文:Dependency injection into views 作者:Steve Smith 翻译:姚阿勇(Dr.Yao) 校对:孟帅洋(书缘) ASP.NET Core 支持在视图中使用 依赖 ...

  7. 开源:Taurus.MVC 框架

    为什么要创造Taurus.MVC: 记得被上一家公司忽悠去负责公司电商平台的时候,情况是这样的: 项目原版是外包给第三方的,使用:WebForm+NHibernate,代码不堪入目,Bug无限,经常点 ...

  8. Taurus.MVC 2.2 开源发布:WebAPI 功能增强(请求跨域及Json转换)

    背景: 1:有用户反馈了关于跨域请求的问题. 2:有用户反馈了参数获取的问题. 3:JsonHelper的增强. 在综合上面的条件下,有了2.2版本的更新,也因此写了此文. 开源地址: https:/ ...

  9. Taurus.MVC 2.0 开源发布:WebAPI开发教程

    背景: 有用户反映,Tausus.MVC 能写WebAPI么? 能! 教程呢? 嗯,木有! 好吧,刚好2.0出来,就带上WEBAPI教程了! 开源地址: https://github.com/cyq1 ...

随机推荐

  1. Web3.js API 中文文档

    Web3.js API 中文文档 http://web3.tryblockchain.org/Web3.js-api-refrence.html web3对象提供了所有方法. 示例: //初始化过程 ...

  2. 安装PG3.0详细教程附图

    从公司要求开始着手调研PG到今天上午都还不知道如何安装PG.. 囧的离谱.. 看了半天的PG官网 就这个网页我瞅了半天..对你没看错 半天 少说有10分钟..原谅我的英文不是非常好..但是我知道什么意 ...

  3. git push跳过用户名和密码认证配置教程

    在使用git commit命令将修改从暂存区提交到本地版本库后,只剩下最后一步将本地版本库的分支推送到远程服务器上对应的分支了,如果不清楚版本库的构成,可以查看我的另一篇,git 仓库的基本结构. 新 ...

  4. 前端框架VUE----导入Bootstrap以及jQuery的两种方式

    Vue引入bootstrap主要有两种方法 方法一:在main.js中引入,此方法导入的bootstrap中对于html,body的一些预设置的css样式可能无效. 一.引入jQuery 在当前项目的 ...

  5. 小纪a

    感觉挺好的两段代码:虽然已经存在,但是这是我自己敲出来的,没有照抄,真心话,所以记录下来. 1.菱形代码: #include <stdio.h>void main() { int i, j ...

  6. lucene 全文检索工具的介绍

    Lucene:全文检索工具:这是一种思想,使用的是C语言写出来的 1.Lucene就是apache下的一个全文检索工具,一堆的jar包,我们可以使用lucene做一个谷歌和百度一样的搜索引擎系统 2. ...

  7. selenium得到弹出窗口

    # 获取当前的页面窗口 first_handle = brower.current_window_handle handles = brower.window_handles for i in han ...

  8. django 处理静态文件

    settings: STATIC_URL = 'static/'STATIC_ROOT = os.path.join(BASE_DIR, 'static') urls: from django.con ...

  9. IOS 苹果手机fiddler抓包时出现了tunnel to 443 解决方案,亲测有效

    先上一张捉取成功图[版本需4.0以上,并非所有https数据可抓取,具体原因未知] 1.先对Fiddler进行设置[打开Fiddler ——> Options .然后打开的对话框中,选择HTTP ...

  10. 【python54--爬虫2】

    1.有道翻译 ''' |-- 代码思路解析: |-- 1.拿到网址首先查看network内Headers的:Request URL:User-Agent:From Data,这几个就是代码所需要的ur ...