我有一個textarea在我的MVC應用程序,當用戶保存例如顯示文本在MVC剃刀
hi
how are
you
但是當用戶希望編輯的textarea它顯示
hi how are you
但我想以這種方式
hi
how are
you
我已經試過
@Html.TextAreaFor(model => model.Notes, new { @class = "form-control", placeholder = "Name", required = "required", @rows = 5 })
不清楚你在問什麼。如果在'textarea'中有3行文本並正確保存,則將其讀回textarea,它將顯示爲3行文本 –
您不能通過textarea保存換行符。因爲你需要使用editorfor剃刀 –
我將使用你的代碼我不清楚你的解決方案 –