CS0123: “Top_Load”的重载均与委托“System.EventHandler”不匹配编译器错误信息: CS0123: “Top_Load”的重载均与委托“System.EventHandler”不匹配
源错误:
行 24: <body style="margin-top:0px">
行 25: <form id="index" method="post" runat="server">
行 26: <Forum:Top id="Top" runat="server" OnLoad="Top_Load">行 27: </Forum:Top>行 28: <table cellspacing="1" cellpadding="6" width="95%" style="text-align:center">
源文件: c:\Inetpub\wwwroot\bbs\Index.aspx 行: 26 index.aspx代码:
<!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 runat="server">
<title><%=Title%></title>
</head>
<body style="margin-top:0px">
<form id="index" method="post" runat="server">
<Forum:Top id="Top" runat="server" OnLoad="Top_Load">
</Forum:Top> <table cellspacing="1" cellpadding="6" width="95%" style="text-align:center">
</table>
.....
</body>index.aspx.cs代码:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.UI;public partial class Index : System.Web.UI.Page
{
public string fbId;
public string Title;
public DataRow[] Config;
public DataRow[] Board;
private void SetModel()
{
Db List = new Db();
fbId = Request.Params["fbId"];
if (Db.Config == null)
{
List.GetCon();
}
if (fbId != null)
{
try
{
Board = Db.Board.Table.Select("Forum_Board_Id=" + Int32.Parse(fbId));
Config = Db.Config.Table.Select("Forum_Config_Id=" + Board[0]["Forum_Board_Class"]);
}
catch
{
List.GetCon();
Board = Db.Board.Table.Select("Forum_Board_Id=" + Int32.Parse(fbId));
Config = Db.Config.Table.Select("Forum_Config_Id=" + Board[0]["Forum_Board_Class"]);
}
}
else
{
Config = Db.Config.Table.Select("Forum_Config_Active='1'");
}
Title = Config[0]["Forum_Config_Name"].ToString() + "--" + NowPath;
} public void Top_Load()
{ } protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
SetModel();
if (!Page.IsPostBack)
{
DirPath();
ForumInfo();
ForumBoard();
ForumLink();
ForumUsers();
SetConfig();
}
}原先我找不到EventHandler方法,后来我添加了 public void EventHandler(Object sender, EventArgs e){ }方法,还是同样的错误,,希望各位高手来帮帮忙啊!!!十分感谢哦!!
源错误:
行 24: <body style="margin-top:0px">
行 25: <form id="index" method="post" runat="server">
行 26: <Forum:Top id="Top" runat="server" OnLoad="Top_Load">行 27: </Forum:Top>行 28: <table cellspacing="1" cellpadding="6" width="95%" style="text-align:center">
源文件: c:\Inetpub\wwwroot\bbs\Index.aspx 行: 26 index.aspx代码:
<!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 runat="server">
<title><%=Title%></title>
</head>
<body style="margin-top:0px">
<form id="index" method="post" runat="server">
<Forum:Top id="Top" runat="server" OnLoad="Top_Load">
</Forum:Top> <table cellspacing="1" cellpadding="6" width="95%" style="text-align:center">
</table>
.....
</body>index.aspx.cs代码:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.UI;public partial class Index : System.Web.UI.Page
{
public string fbId;
public string Title;
public DataRow[] Config;
public DataRow[] Board;
private void SetModel()
{
Db List = new Db();
fbId = Request.Params["fbId"];
if (Db.Config == null)
{
List.GetCon();
}
if (fbId != null)
{
try
{
Board = Db.Board.Table.Select("Forum_Board_Id=" + Int32.Parse(fbId));
Config = Db.Config.Table.Select("Forum_Config_Id=" + Board[0]["Forum_Board_Class"]);
}
catch
{
List.GetCon();
Board = Db.Board.Table.Select("Forum_Board_Id=" + Int32.Parse(fbId));
Config = Db.Config.Table.Select("Forum_Config_Id=" + Board[0]["Forum_Board_Class"]);
}
}
else
{
Config = Db.Config.Table.Select("Forum_Config_Active='1'");
}
Title = Config[0]["Forum_Config_Name"].ToString() + "--" + NowPath;
} public void Top_Load()
{ } protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
SetModel();
if (!Page.IsPostBack)
{
DirPath();
ForumInfo();
ForumBoard();
ForumLink();
ForumUsers();
SetConfig();
}
}原先我找不到EventHandler方法,后来我添加了 public void EventHandler(Object sender, EventArgs e){ }方法,还是同样的错误,,希望各位高手来帮帮忙啊!!!十分感谢哦!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货