这个错误的解决方案是什么。?编译器错误消息:BC30456:'Button1_Click'不是'ASP.login_aspx'的成员。 [英] What is the solution of this error.?Compiler Error Message: BC30456: 'Button1_Click' is not a member of 'ASP.login_aspx'.
本文介绍了这个错误的解决方案是什么。?编译器错误消息:BC30456:'Button1_Click'不是'ASP.login_aspx'的成员。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="logindemo.login" %>--%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td colspan="3" dir="ltr" style="background-color: #66CCFF"> LOGIN</td>
</tr>
<tr>
<td>Username</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" Width="188px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="enter username" ForeColor="Red" ValidationGroup="LoginGroup"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Password</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" TextMode="Password" Width="188px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2" Display="Dynamic" ErrorMessage="enter password" ForeColor="Red" ValidationGroup="LoginGroup"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Login" ValidationGroup="LoginGroup" />
</td>
<td>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Reset" style="height: 26px" />
</td>
<td>
<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="New Register" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
推荐答案
你需要一个名为Button1_Click的代码隐藏方法,看起来像
You need a method in your code-behind called Button1_Click that looks like
protected void Button1_Click(object sender, EventArgs e)
{
// your code here
}
这篇关于这个错误的解决方案是什么。?编译器错误消息:BC30456:'Button1_Click'不是'ASP.login_aspx'的成员。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文