对于第 18 行,即 asp:Button 行,我收到错误 CS0118,表示它被用作方法而不是字段。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" method="post" runat="server">
<div>
<br />
<asp:TextBox ID="txtUserName" runat="server" Width="294px"></asp:TextBox>
<br />
<br />
</div>
<p>
<asp:Button ID="btnLogin" PostBackUrl="~/WebForm2.aspx" runat="server" Height="101px" OnClick="btnLogin"></asp:Button>
</p>
</form>
</body>
</html>