-----多界面连接问题---

Powerliang 2003-10-11 01:53:01
初学C#,新建了一个AspWeb.net应用程序,
现在想连接多个子界面,但是第一个按钮能够连接到一个子界面,但 同样的 方法,第二个按钮却连不上第二个子页面。为什么?我在InitializeComponent()加入代码,不对,为什么?
private void InitializeComponent()
{
this.ButtonRegist.Click += new System.EventHandle(this.ButtonRegist_Click);
this.Load += new System.EventHandler(this.Page_Load);

//加入以下代码却不对
this.ButtonView_Click.Click += new System.EventHandle(this.ButtonView_Click_Click)
this.Load += new System.EventHandler(this.Page_Load);
}
//第一个按钮
private void ButtonRegist_Click(object sender, System.EventArgs e)
{
string url;
url="test.htm" ;
Response.Redirect(url);

}

//第二个按钮(连接不上)
private void ButtonView_Click(object sender, System.EventArgs e)
{
string str;
str="WebForm3.aspx?" ;
Response.Redirect(str);
}
...全文
28 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
huzhaoliang 2003-10-11
  • 打赏
  • 举报
回复
改为:this.ButtonRegist.Click += new System.EventHandle(this.ButtonRegist_Click);
this.ButtonView_Click.Click += new System.EventHandle(this.ButtonView_Click_Click)

this.Load += new System.EventHandler(this.Page_Load);

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧