TextAreaFor Cannot Set Width

前端 未结 5 1464
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 06:24

I cannot set the width or cols in atextarea. Rows/Height works just fine. can someone please help thanks!

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken(         


        
5条回答
  •  囚心锁ツ
    2021-02-07 06:44

    You can add a class attribute:

    @Html.TextAreaFor(model => model.Comments, new {cols=60, rows=10, @class="form-control" })
    

提交回复
热议问题