我有以下cshtml登录表单:
<div class="editor-label">
@Html.LabelFor(model => model.UserEmailAddress)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.UserEmailAddress, new {@class = "k-textbox", style="width:200px"})
@Html.ValidationMessageFor(model => model.UserEmailAddress)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.UserPassword)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.UserPassword, new { @class = "k-textbox", style="width:200px" })
@Html.ValidationMessageFor(model => model.UserPassword)
</div>
电子邮件地址是 typr 类k-textbox
,但密码是text-box single-line password
. 因此两者具有不同的宽度。即使在我尝试明确指定宽度和类之后。我正在为 MVC 使用 KendoUI。输出是:
这是页面来源:
<div class="editor-label">
<label for="UserEmailAddress">User Name (Email Id)</label>
</div>
<div class="editor-field">
<input class="k-textbox" data-val="true" data-val-regex="E-mail is not valid" data-val-regex-pattern="^[a-zA-Z0-9_\.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$" data-val-required="The User Name (Email Id) field is required." id="UserEmailAddress" name="UserEmailAddress" type="text" value="" />
<span class="field-validation-valid" data-valmsg-for="UserEmailAddress" data-valmsg-replace="true"></span>
</div>
<div class="editor-label">
<label for="UserPassword">UserPassword</label>
</div>
<div class="editor-field">
<input class="text-box single-line password" data-val="true" data-val-required="Password required" id="UserPassword" name="UserPassword" type="password" value="" />
<span class="field-validation-valid" data-valmsg-for="UserPassword" data-valmsg-replace="true"></span>
</div>
这两者如何由相同的类、样式和宽度制成。