日期:2014-05-18 浏览次数:21006 次
vs2008环境,编译器错误消息: CS0117: “ASP.input_aspx”并不包含“Button1_Click”的定义
行 15: <asp:Button ID="Button1" runat="server" Text="确认提交" onclick="Button1_Click" />
如果把“确认提交”及“放弃退出”部分注释掉就正常,错在哪里?怎么改?
Input.aspx文件:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Input.aspx.cs" Inherits="WebApplication1.Input" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
<title>测试</title>
<body>
<table border="0" style="text-align: center" "z-index 100; left: 300px; width: 350px; position: static; top: 947px">
<tr>
<%-- <td style="width: 230px; text-align: center;">
<asp:Button ID="Button1" runat="server" Text="确认提交" onclick="Button1_Click" />
</td>
<td style="width: 230px; text-align: center;">
<asp:Button ID="Button2" runat="server" Text="放弃退出" onclick="Button2_Click" />
</td>--%>
</tr>
</table>
</div>
</form>
</body>
</html>
input.aspx.cs文件:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication1
{
public partial class Input : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
}
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Input.aspx.cs" Inherits="WebApplication5.Input" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>测试</title>
</head>
<body>
<form>
<div>
<table border="0" style="text-align: center" "z-index 100; left: 300px; width: 350px; position: static; top: 947px">
<tr>
<td style="width: 230px; text-align: center;">
<asp:Button ID="Button1" runat="server" Text="确认提交" onclick="Button1_Click" />
</td>
<td style="width: 230px; text-align: center;">
<asp:Button ID="Button2" runat="server" Text="放弃退出" onclick="Button2_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
------解决方案--------------------
楼上+1
WPF里如何隐藏取消任务栏