c# - 无法将样式和占位符添加到 @Html.TextAreaFor
问题描述
我正在使用以下 html 标记:
@Html.TextAreaFor(Model => Model.TaxID,
new {styles = "width:30%; border-color: black; maxlength: 9" @placeholder = "xxxxxxxxx"})
我无法检索任何样式,最大长度超过 9 个字符,@placeholder 抛出错误。有人可以帮我弄这个吗。
解决方案
这样做的正确方法是这样的,注意它应该是“style”而不是“styles”,你也错过了and和 the,
之间的一个应该也在之外:style
placeholder
maxlength
style
new { placeholder = "xxx", maxlength=9, style = "width:30%; border-color: black;" }
推荐阅读
- c - 是否只有基于系统调用的功能?
- javascript - 使用角管html将日期从yyyymmdd转换为yyyy/mm/dd甲酸盐
- node.js - 如何在 Sequelize 中进行全局错误处理
- java - Java服务器上Google App Engine中的CORS错误
- machine-learning - 虚拟变量 - 这些二进制变量的值可以大于 1 吗?
- docker - 为什么 Traefik 在后端网络上发现容器 IP 地址?
- sql - Google Cloud SQL 导入 2005 备份失败
- python-3.x - AttributeError:“NoneType”对象没有属性“image_data_format”keras
- python - ImportError:没有名为“dask.dataframe”的模块;
- r - 如何使 purrr 包中的 map_df 返回一个小标题?