Wie setze ich den Wert in @ Html.TextBoxFor in der Razor-Syntax?

Habe ich erstellt eine text-box mit Razor und versuchen value wie folgt.

@Html.TextBoxFor(model => model.Destination, new { id = "txtPlace", value= "3" })

Habe ich versucht Anhängen value mit @

@Html.TextBoxFor(model=> model.Destination, new { id = "txtPlace", @value= "3" })

obwohl es rendert html - input tag mit leeren value

<input id="txtPlace" name="Destination" type="text" value 
   class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset ui-mini" >

Was falsch mache?

InformationsquelleAutor der Frage viki | 2012-12-21

Schreibe einen Kommentar