2013-11-01 39 views
0

我確信這個問題出現了很多,但是我在檔案中找不到答案。 這裏是我的ASP代碼:文本框在當前上下文中不存在

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RCC_ChangePassword.ascx.cs" Inherits="Regal.Web._Tester.RCC.RCC_ChangePassword" %> 
    <div id="modal-password-change"> 
     <div class="modal-contents"> 

      <h1>Change Password</h1> 
      <div class="intro">Use the form below to change the password for your RCC account. Use the new password next time you log in.</div> 

      <asp:Label ID="CurPass" Text="Current Password" runat="server"></asp:Label> 
      <asp:Textbox id="CurrentPass" runat="server" CssClass="required"></asp:Textbox> 

      <asp:Label ID="NwPass" Text="New Password*" runat="server"></asp:Label> 
      <asp:Textbox id="NewPass" runat="server" CssClass="required"></asp:Textbox> 

      <asp:Label ID="CnfPass" Text="Confirm Password" runat="server"></asp:Label> 
      <asp:Textbox id="ConfirmPass" runat="server" CssClass="required"></asp:Textbox> 

      <h4>Your password must include ALL of the following</h4> 
      <ul class="notes"> 
       <li>At least 8 characters (not more than 16 characters)</li> 
       <li>At least one number</li> 
      </ul> 

      <asp:Button ID="submit" Cssclass="btn blue wide" runat="server" Text="Save Changes" OnClick="btnSubmit_click"></asp:Button> 

     </div> 

    </div><!-- #modal-password-change .modal --> 

這裏是我得到的錯誤行:

// Change actual password for the new password  
         String testPass1 = NewPass.Text;  
         if (regalMemberRepo.ChangePassword(oUser.Email, oUser.Password, testPass1)) 

,你可以看到我的代碼什麼奇怪? 預先感謝您。

+2

這發生在我身上,經常與VS.看一下設計器文件,看VS是否在文本框中創建了一個條目?確保你沒有其他文件在某個地方有類似的聲明。 – IrishChieftain

+0

謝謝...我會看。感謝您的時間 –

+0

設計師應該至少有一個文本框的條目? –

回答

1

這發生在我身上,經常與VS.看一下設計器文件,看VS是否在文本框中創建了一個條目?確保你沒有其他文件在某個地方有類似的聲明。

很多時候,解決這個問題的最好方法是刪除,重新創建並重命名錶單。我們不應該自己編輯設計器文件。

相關問題