اقرأ باللغة الإنجليزية

مشاركة عبر


IHtmlGenerator Interface

Definition

Contract for a service supporting IHtmlHelper and ITagHelper implementations.

C#
public interface IHtmlGenerator
Derived

Properties

IdAttributeDotReplacement

Gets the replacement for '.' in an Id attribute.

Methods

Encode(Object)

Encodes a value.

Encode(String)

Encodes a value.

FormatValue(Object, String)

Format a value.

GenerateActionLink(ViewContext, String, String, String, String, String, String, Object, Object)

Generate a <a> element for a link to an action.

GenerateAntiforgery(ViewContext)

Generate an <input type="hidden".../> element containing an antiforgery token.

GenerateCheckBox(ViewContext, ModelExplorer, String, Nullable<Boolean>, Object)

Generate a <input type="checkbox".../> element.

GenerateForm(ViewContext, String, String, Object, String, Object)

Generate a <form> element. When the user submits the form, the action with name actionName will process the request.

GenerateGroupsAndOptions(String, IEnumerable<SelectListItem>)

Generates <optgroup> and <option> elements.

GenerateHidden(ViewContext, ModelExplorer, String, Object, Boolean, Object)

Generate a <input type="hidden"> element

GenerateHiddenForCheckbox(ViewContext, ModelExplorer, String)

Generate an additional <input type="hidden".../> for checkboxes. This addresses scenarios where unchecked checkboxes are not sent in the request. Sending a hidden input makes it possible to know that the checkbox was present on the page when the request was submitted.

GenerateLabel(ViewContext, ModelExplorer, String, String, Object)

Generate a <label> element

GeneratePageForm(ViewContext, String, String, Object, String, String, Object)

Generate a <form> element. When the user submits the form, the page with name pageName will process the request.

GeneratePageLink(ViewContext, String, String, String, String, String, String, Object, Object)

Generate a <a> element for a link to an action.

GeneratePassword(ViewContext, ModelExplorer, String, Object, Object)

Generate a <input type="password"> element

GenerateRadioButton(ViewContext, ModelExplorer, String, Object, Nullable<Boolean>, Object)

Generate a <input type="radio"> element

GenerateRouteForm(ViewContext, String, Object, String, Object)

Generate a <form> element. The route with name routeName generates the <form>'s action attribute value.

GenerateRouteLink(ViewContext, String, String, String, String, String, Object, Object)

Generate a <a> element for a link to an action.

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, Boolean, Object)

Generate a <select> element for the expression.

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, ICollection<String>, Boolean, Object)

Generate a <select> element for the expression.

GenerateTextArea(ViewContext, ModelExplorer, String, Int32, Int32, Object)

Generates a <textarea> element

GenerateTextBox(ViewContext, ModelExplorer, String, Object, String, Object)

Generates a <input type="text"> element

GenerateValidationMessage(ViewContext, ModelExplorer, String, String, String, Object)

Generate a tag element if the viewContext's ModelState contains an error for the expression.

GenerateValidationSummary(ViewContext, Boolean, String, String, Object)

Generates a <div> element which contains a list of validation errors.

GetCurrentValues(ViewContext, ModelExplorer, String, Boolean)

Gets the collection of current values for the given expression.

Extension Methods

Applies to

منتج الإصدارات
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0