我完全糊涂了.我在页面上有6个输入用于注册页面.其中三个盒子在盒子的右侧有所需的指示器,其他三个没有.代码中需要所有6个字段.
我查看了代码,MVC正在添加背景图像或Bootstrap.这是我正在使用的Razor代码.
@Html.TextBoxFor(m => m.currentUser.UserName, new { @class = "form-control", placeholder = "user name", tabindex = 1 })@Html.PasswordFor(m => m.currentUser.Password, new { @class = "form-control", placeholder = "password", tabindex = 3 })@Html.TextBoxFor(m => m.currentUser.LastName, new { @class = "form-control", placeholder = "last name", tabindex = 6 })@Html.TextBoxFor(m => m.currentUser.EmailAddress, new { @class = "form-control", placeholder = "email address", tabindex = 2 })@Html.PasswordFor(m => m.confrimPassword, new { @class = "form-control", placeholder = "confirm password", tabindex = 4 })@Html.TextBoxFor(m => m.currentUser.FirstName, new { @class = "form-control", placeholder = "first name", tabindex = 5 })
我没有很多使用Bootstrap的经验,所以我不确定这是导致问题的原因还是MVC.
任何帮助表示赞赏.
这是模型类:
public class User { public int ID { get; set; } [Required(ErrorMessage = "Please enter a User Name.")] public string UserName { get; set; } [Required(ErrorMessage = "Please enter a password")] public string Password { get; set; } [Required(ErrorMessage = "Please enter your first name.")] public string FirstName { get; set; } [Required(ErrorMessage = "Please enter your last name.")] public string LastName { get; set; } [Required(ErrorMessage = "Please enter an email address.")] public string EmailAddress { get; set; } }
这是具有指标的输入的生成代码:
真正奇怪的部分是我发现它们出现在Chrome中而不是Firefox中.
@nemesv - 你是完全正确的.LastPass是我在Chrome中安装的扩展程序之一.一旦我禁用它,图标就被删除了.把头发拉了几天试图找出那个.