Classe TextAreaExtensions (System.Web.Mvc.Html)

Cambia visualizzazione:
ScriptFree
Riferimento a .NET Framework
Classe TextAreaExtensions
Il presente articolo è stato tradotto manualmente. Per visualizzare questa pagina e contemporaneamente visualizzarne il contenuto in lingua inglese, passare alla visualizzazione semplificata.

Rappresenta il supporto per i controlli textarea HTML.

Gerarchia di ereditarietà

System.Object
  System.Web.Mvc.Html.TextAreaExtensions

Spazio dei nomi:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
Sintassi

Visual Basic - (Dichiarazione)
<ExtensionAttribute> _
Public NotInheritable Class TextAreaExtensions
Visual Basic (Utilizzo)
Non è necessario dichiarare un'istanza di una classe statica per accedere ai relativi membri.
C#
public static class TextAreaExtensions
Visual C++
[ExtensionAttribute]
public ref class TextAreaExtensions abstract sealed
JScript
public final class TextAreaExtensions
Metodi

  Nome Descrizione
Metodo pubblico Membro statico TextArea(HtmlHelper, String) Restituisce l'elemento textarea specificato utilizzando l'helper HTML e il nome del campo del form specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, IDictionary<String, Object>) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form e gli attributi HTML specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, Object) Restituisce l'elemento textarea specificato utilizzando l'helper HTML e gli attributi HTML specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, String) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form e il contenuto di testo specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, String, IDictionary<String, Object>) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form, il contenuto di testo e gli attributi HTML specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, String, Object) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form, il contenuto di testo e gli attributi HTML specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, String, Int32, Int32, IDictionary<String, Object>) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form, il contenuto di testo, il numero di righe e colonne e gli attributi HTML specificati.
Metodo pubblico Membro statico TextArea(HtmlHelper, String, String, Int32, Int32, Object) Restituisce l'elemento textarea specificato utilizzando l'helper HTML, il nome del campo del form, il contenuto di testo, il numero di righe e colonne e gli attributi HTML specificati.
Metodo pubblico Membro statico TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>) Restituisce un elemento HTML textarea per ogni proprietà nell'oggetto rappresentato dall'espressione specificata.
Metodo pubblico Membro statico TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IDictionary<String, Object>) Restituisce un elemento HTML textarea per ogni proprietà nell'oggetto rappresentato dall'espressione specificata, utilizzando gli attributi HTML specificati.
Metodo pubblico Membro statico TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Object) Restituisce un elemento HTML textarea per ogni proprietà nell'oggetto rappresentato dall'espressione specificata, utilizzando gli attributi HTML specificati.
Metodo pubblico Membro statico TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Int32, Int32, IDictionary<String, Object>) Restituisce un elemento HTML textarea per ogni proprietà nell'oggetto rappresentato dall'espressione specificata, utilizzando gli attributi HTML e il numero di righe e colonne specificati.
Metodo pubblico Membro statico TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, Int32, Int32, Object) Restituisce un elemento HTML textarea per ogni proprietà nell'oggetto rappresentato dall'espressione specificata, utilizzando gli attributi HTML e il numero di righe e colonne specificati.
In alto
Note

The TextAreaExtensions class contains methods that extend the HtmlHelper class. Each extension method renders an HTML textarea element. The TextArea method renders an element that enables the user to enter multiple lines of text that is then submitted to the Web server.

Esempi

The following example shows how to create a form that enables the user to enter text for an article and to enter the article title. The form provides a TextArea helper method that is used to enter the article text. The method also passes an anonymous object that contains the HTML attributes that are used to render the textarea element.

When the user submits the form, the TextArea action method handles the request. This method uses a regular expression to replace newline (\n) characters with HTML br elements in order to retain paragraph formatting.

The following example shows the view that is rendered in order to display the text that was submitted.

Codice thread safe

Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.
Vedere anche

Riferimenti

Altre risorse