0

我在 ASP.Net MVC 中工作。我必须提交一个表单,我只能通过显示错误消息来验证它。但我不想text在出现错误的情况下显示,而是想显示image. 请告诉我如何images在 ASP.Net 表单验证过程中显示,而不是text.

4

1 回答 1

0

你可以像这样使用
你可以像下面这样创建 CSS

input[type="email"] {
    background: url('images/envelope.png') no-repeat center left 5px;
    padding-left: 50px; /* depends on width of envelope image */
}
input[type="email"].input-validation-error {
    background: url('images/envelope.png') no-repeat center left 5px, url('images/cross.png') no-repeat center right 5px;
}

详细信息:-
文本框的 MVC4 图形验证

于 2013-05-31T10:05:18.997 回答