【发布时间】:2018-02-07 01:19:44
【问题描述】:
我在为 asp.net 网页使用验证码时遇到问题。 一切似乎都正常,只是重新加载和声音按钮没有像应有的那样位于验证码图像旁边。相反,它们位于文本框下方(如下图)
关于如何解决这个问题的任何帮助?
代码是:
<fieldset>
<legend>Registration Form</legend>
<ol>
<li class="email">
<label for="email" @if(!ModelState.IsValidField("email")){<text>class="error-label"</text>}>Email address</label>
<input type="text" id="email" name="email" value="@email" @Validation.For("email") />
@* Write any email validation errors to the page *@
@Html.ValidationMessage("email")
</li>
<li class="password">
<label for="password" @if(!ModelState.IsValidField("password")) {<text>class="error-label"</text>}>Password</label>
<input type="password" id="password" name="password" @Validation.For("password") />
@* Write any password validation errors to the page *@
@Html.ValidationMessage("password")
</li>
<li class="confirm-password">
<label for="confirmPassword" @if(!ModelState.IsValidField("confirmPassword")) {<text>class="error-label"</text>}>Confirm password</label>
<input type="password" id="confirmPassword" name="confirmPassword" @Validation.For("confirmPassword") />
@* Write any password validation errors to the page *@
@Html.ValidationMessage("confirmPassword")
</li>
<li class="recaptcha">
@Html.Label("Retype the code from the picture:", "CaptchaCode")
<p></p>
@{
Captcha exampleCaptcha = new Captcha("ExampleCaptcha");
exampleCaptcha.CodeLength = 4;
exampleCaptcha.ImageSize = new System.Drawing.Size(240, 70);
exampleCaptcha.UseHorizontalIcons = true;
exampleCaptcha.UserInputID = "CaptchaCode";
exampleCaptcha.AdditionalCssClasses = "class1 class2 class3";
}
@Html.Raw(exampleCaptcha.Html)
@Html.TextBox("CaptchaCode")
</li>
</ol>
<input type="submit" value="Register" />
</fieldset>
谢谢, 迪尼斯
【问题讨论】:
-
您的代码在哪里。 ?
-
抱歉,刚刚把代码贴在原帖里了。