Share via


IHtmlHelper.TextBox(String, Object, String, Object) Metodo

Definizione

Restituisce un <elemento di input> di tipo "text" per l'oggetto specificato expression. Aggiunge un attributo "value" all'elemento contenente il primo valore nonnull trovato in: la ModelState voce con nome completo, il value parametro, la ViewData voce con nome completo, la expression classe valutata Modelin o la voce del htmlAttributes dizionario con chiave "value". Per altre informazioni su un nome completo, vedere Name(String) .

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(System::String ^ current, System::Object ^ value, System::String ^ format, System::Object ^ htmlAttributes);
public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(System::String ^ expression, System::Object ^ value, System::String ^ format, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Html.IHtmlContent TextBox (string current, object value, string format, object htmlAttributes);
public Microsoft.AspNetCore.Html.IHtmlContent TextBox (string expression, object value, string format, object htmlAttributes);
abstract member TextBox : string * obj * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
abstract member TextBox : string * obj * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function TextBox (current As String, value As Object, format As String, htmlAttributes As Object) As IHtmlContent
Public Function TextBox (expression As String, value As Object, format As String, htmlAttributes As Object) As IHtmlContent

Parametri

currentexpression
String

Nome dell'espressione, relativo al modello corrente.

value
Object

Se non ènull , valore da includere nell'elemento .

format
String

Stringa di formato (vedere https://msdn.microsoft.com/en-us/library/txafckwd.aspx) utilizzata per formattare l'attributo "value", a meno che non provenisse dall'associazione di modelli.

htmlAttributes
Object

Oggetto Object contenente gli attributi HTML per l'elemento . In alternativa, un'istanza IDictionary<TKey,TValue> contenente gli attributi HTML.

Restituisce

Nuovo IHtmlContent oggetto contenente l'elemento <di input> .

Commenti

HtmlFieldPrefix Combina e expression per impostare <l'attributo "name" dell'elemento di input>. Sanifica expression l'attributo "id" dell'elemento.

Si applica a