【问题标题】:TextAreaFor box size is not increasing in ASP.NET MVC Razor [duplicate]ASP.NET MVC Razor中的TextAreaFor框大小没有增加[重复]
【发布时间】:2017-09-06 04:35:21
【问题描述】:

我正在尝试增加 Razor 中的文本框列大小,但它不起作用。

这是我的 Razor 代码:

@Html.TextAreaFor(model => model.JobDescription, 
                  htmlAttributes: new { @class = "form-control", @rows = 2, @cols = 30 })

下面是我的网页截图:

但我需要这样的东西:

我不明白,谁能帮我做这个?

【问题讨论】:

  • 错字警告:它是 Razor - 不是“rozar”或您使用过的任何其他东西......

标签: html asp.net-mvc razor


【解决方案1】:

你不需要@每个html attr @在这里与类一起使用来逃避c#类尝试

 @Html.TextAreaFor(model => model.JobDescription, htmlAttributes: new { @class = "form-control",rows = "2",cols = "30" })

【讨论】:

  • 嗨,Rahul,在实现您的代码后,它没有提供所需的输出。
猜你喜欢
  • 1970-01-01
  • 2011-01-03
  • 1970-01-01
  • 2014-08-31
  • 1970-01-01
  • 1970-01-01
  • 2011-09-01
  • 2012-01-04
  • 1970-01-01
相关资源
最近更新 更多