私は、Razorを使用してテキストボックスを作成し、value
を次のように設定しようとしました。Razor構文の@ Html.TextBoxForに値を設定する方法は?
@Html.TextBoxFor(model => model.Destination, new { id = "txtPlace", value= "3" })
私はそれが間違ってやっている何を空value
<input id="txtPlace" name="Destination" type="text" value
class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset ui-mini" >
とHTML input
タグをレンダリングしていても@
@Html.TextBoxFor(model=> model.Destination, new { id = "txtPlace", @value= "3" })
でvalue
を追加しようとしましたか?
が重複する可能性を(http://stackoverflow.com/questions/3034986/how-to -set-a-default-value-with-html-textboxfor) –