2017-08-29 132 views
0

我在使用captcha進行asp.net網頁時遇到了問題。 一切似乎工作正常,除了重新加載和聲音按鈕不應該位於驗證碼圖像旁邊,因爲它們應該是。相反,它們是文本框的下方(圖像波紋管)驗證碼重新加載和聲音按鈕

captcha_error

如何解決這個任何幫助嗎?

的代碼是:

<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> 

感謝, 迪尼斯

+0

哪裏是你的代碼。 ? – Ravikumar

+0

對不起,只是在原帖中發佈了代碼。 – D1N15

回答

0

好的球員,問題解決了!

我忘了添加下面的行頭部分:

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