css – Bootstrap MVC 4 TextBoxFor必需指标

前端之家收集整理的这篇文章主要介绍了css – Bootstrap MVC 4 TextBoxFor必需指标前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我完全糊涂了.我在页面上有6个输入用于注册页面.其中三个盒子在盒子的右侧有所需的指示器,其他三个没有.代码中需要所有6个字段.

我查看了代码,MVC正在添加背景图像或Bootstrap.
这是我正在使用的Razor代码.

<div class="row ">
            <div class="col-md-6">
                <div class="row">
                    @Html.TextBoxFor(m => m.currentUser.UserName,new { @class = "form-control",placeholder = "user name",tabindex = 1 })

                </div>

                <div class="row">
                    @Html.PasswordFor(m => m.currentUser.Password,placeholder = "password",tabindex = 3 })

                </div>
                <div class="row">
                    @Html.TextBoxFor(m => m.currentUser.LastName,placeholder = "last name",tabindex = 6 })

                </div>
            </div>
            <div class="col-md-6">
                <div class="row">
                    @Html.TextBoxFor(m => m.currentUser.EmailAddress,placeholder = "email address",tabindex = 2 })
                </div>
                <div class="row">
                    @Html.PasswordFor(m => m.confrimPassword,placeholder = "confirm password",tabindex = 4 })

                </div>
                <div class="row">
                    @Html.TextBoxFor(m => m.currentUser.FirstName,placeholder = "first name",tabindex = 5 })

                </div>
            </div>
        </div>

我没有很多使用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; }
}

这是具有指标的输入的生成代码

<input class="form-control" data-val="true" data-val-required="Please enter a password" id="currentUser_Password" name="currentUser.Password" placeholder="password" tabindex="3" type="password" autocomplete="off" keyev="true" clickev="true" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QsPDhss3LcOZQAAAU5JREFUOMvdkzFLA0EQhd/bO7iIYmklaCUopLAQA6KNaawt9BeIgnUwLHPJRchfEBR7CyGWgiDY2SlIQBT/gDaCoGDudiy8SLwkBiwz1c7y+GZ25i0wnFEqlSZFZKGdi8iiiOR7aU32QkR2c7ncPcljAARAkgckb8IwrGf1fg/oJ8lRAHkR2VDVmOQ8AKjqY1bMHgCGYXhFchnAg6omJGcBXEZRtNoXYK2dMsaMt1qtD9/3p40x5yS9tHICYF1Vn0mOxXH8Uq/Xb389wff9PQDbQRB0t/QNOiPZ1h4B2MoO0fxnYz8dOOcOVbWhqq8kJzzPa3RAXZIkawCenHMjJN/+GiIqlcoFgKKq3pEMAMwAuCa5VK1W3SAfbAIopum+cy5KzwXn3M5AI6XVYlVt1mq1U8/zTlS1CeC9j2+6o1wuz1lrVzpWXLDWTg3pz/0CQnd2Jos49xUAAAAASUVORK5CYII=); padding-right: 0px; background-attachment: scroll; cursor: auto; background-position: 100% 50%; background-repeat: no-repeat no-repeat;">

真正奇怪的部分是我发现它们出现在Chrome中而不是Firefox中.

解决方法

@nemesv – 你说得对. LastPass是我在Chrome中安装的扩展程序之一.一旦我禁用它,图标就被删除了.把头发拉了几天试图找出那个.

猜你在找的CSS相关文章