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
HTML Help is used to modify the HTML output.
By MVC, HTML Help is similar to a traditional ASP.NET Web Form controls.
Like in ASP.NET Web Form Controls, HTML Help is used to modify HTML. However, HTML Help is more lightweight. Web Form with different controls, HTML Help does not view state and event model.
In most cases, HTML helper is just a method that returns a string.
By MVC, you can create your own helper, or directly using the built-in HTML helper.
MVC includes the most common types of standard HTML elements helper, such as HTML links and HTML form elements.
The easiest way is to use the rendered HTML link HTML.ActionLink () helper.
By MVC, Html.ActionLink () is not connected to view. It creates a connection to the controller operation.
Razor syntax:
ASP syntax:
The first parameter is the link text, and the second parameter is the name of the controller operation.
The above Html.ActionLink () helper, outputs the following HTML:
Html.ActionLink () to help some of the properties:
属性 | 描述 |
---|---|
.linkText | URL 文本(标签),定位点元素的内部文本。 |
.actionName | 操作(action)的名称。 |
.routeValues | 传递给操作(action)的值,是一个包含路由参数的对象。 |
.controllerName | 控制器的名称。 |
Attributes | URL 的属性设置,是一个包含要为该元素设置的 HTML 特性的对象。 |
.protocol | URL 协议,如 "http" 或 "https"。 |
.hostname | URL 的主机名。 |
.fragment | URL 片段名称(定位点名称)。 |
Note: You can pass a value to the controller. For example, you can transfer operations to the database Edit database records id:
Razor syntax of C #:
Razor syntax VB:
The above Html.ActionLink () helper, outputs the following HTML:
The following can be used to render HTML Help (modification and output) HTML form elements:
ASP.NET Syntax C #: