【问题标题】:Captcha reload and sound buttons验证码重新加载和声音按钮
【发布时间】: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>

谢谢, 迪尼斯

【问题讨论】:

  • 您的代码在哪里。 ?
  • 抱歉,刚刚把代码贴在原帖里了。

标签: asp.net captcha


【解决方案1】:

好的,问题解决了!

我忘记在 head 部分添加以下行:

<link href="@BotDetect.Web.CaptchaUrls.Absolute.LayoutStyleSheetUrl" rel="stylesheet" type="text/css" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-19
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多