HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Web Pages are often associated with the object.
You've already seen some of the Page object methods in use:
In the previous chapter, you have seen two Page object properties (isPost and Request):
方法 | 描述 |
---|---|
href | 使用指定的值创建 URL。 |
RenderBody() | 呈现不在布局页命名区域的内容页的一部分。 |
RenderPage( page ) | 在另一个页面中呈现某一个页面的内容。 |
RenderSection( section ) | 呈现布局页命名区域的内容。 |
Write( object ) | 将对象作为 HTML 编码字符串写入。 |
WriteLiteral | 写入对象时优先不使用 HTML 编码。 |
属性 | 描述 |
---|---|
isPost | 如果客户端使用的 HTTP 数据传输方法是 POST 请求,则返回 true。 |
Layout | 获取或者设置布局页面的路径。 |
Page | 提供了对页面和布局页之间共享的数据的类似属性访问。 |
Request | 为当前的 HTTP 请求获取 HttpRequest 对象。 |
Server | 获取 HttpServerUtility 对象,该对象提供了网页处理方法。 |
Page Page object attribute, that provides access to shared similar properties between pages and page layout data.
You can use the Page Properties (add) your own attributes:
Page properties are very useful. For example, set the page title in the content file and use the layout file: