我正在尝试使用 Visual Studio 2012 为我的 ASP.NET 空网站使用另一个模板。因此,我使用不同的模板将早期项目中的一些代码复制并粘贴到该项目中,现在我收到此错误:
ASP.site_master' does not contain a definition for 'btnRegister_Click' and no extension method 'btnRegister_Click' accepting a first argument of type 'ASP.site_master' could be found (are you missing a using directive or an assembly reference?)
这是我的代码:
<div id="login-box" class="login-popup">
<a href="#" class="close"><img src="http://localhost:12345/CAPSTONE/images/process-stop.png" class="btn_close" title="Close Window" alt="Close" /></a>
<form class="signin">
<div class="control-group normal_text"><h3>My Site Login</h3></div>
<asp:Panel ID="pnlError" runat="server" Visible="false">
<div class="alert alert-error">
<strong>Error!</strong> Invalid username / password.
</div>
</asp:Panel>
<asp:Panel ID="pnlConfirmed" runat="server" Visible="false">
<div class="alert alert-success">
<strong>User Activated!</strong> You may now login.
</div>
</asp:Panel>
<asp:Panel ID="pnlReset" runat="server" Visible="false">
<div class="alert alert-success">
Your password has been changed. You may now login.
</div>
</asp:Panel>
<div class="control-group">
<div class="controls">
<div class="main_input_box">
<span class="add-on"><i class="icon-user"></i></span><asp:TextBox ID="txtEmail" runat="server" MaxLength="70" placeholder="Email Address" />
<span class="add-on"><i class="icon-lock"></i></span><asp:TextBox ID="txtPassword" runat="server" MaxLength="50" TextMode="Password" placeholder="Password" />
</div>
</div>
</div>
<div class="form-actions">
<span class="pull-left"><asp:Button ID="btnRegister" runat="server"
class="btn btn-inverse" Text="Register" onclick="btnRegister_Click" /></span>
<span class="pull-right"><a href="ForgotPassword.aspx">Forgot Password</a>
<asp:Button ID="btnLogin" runat="server"
class="btn btn-success" Text="Login" onclick="btnLogin_Click" />
</span>
</div>
我应该怎么办?