<div class="labelled-text-field">
@Html.LabelFor(x => x.Email)
@Html.TextBoxFor(x => x.Email)
@Html.ValidationMessageFor(x => x.Email)
</div>
使用右键单击时->粘贴标签与粘贴的电子邮件重叠:
键入或使用Ctrl + v(粘贴)时效果很好:
我不知道使用剃刀oncopy事件是否可以解决此问题:
@Html.TextBoxFor(x => x.Email,
new {
@class = "input_box",
id = "txtDays",
onpaste=""
}
)
答案 0 :(得分:0)
尝试使用占位符属性。粘贴文本时,它将清除水印。
<div class="labelled-text-field">
@Html.LabelFor(x => x.Email)
@Html.TextBoxFor(x => x.Email, new {placeholder="Your Email" })
@Html.ValidationMessageFor(x => x.Email)
</div>