在vs2008里asp.net中 如果想要点击button按钮就会转到下一个网页 怎么写代码?

2024-12-15 04:37:48
推荐回答(4个)
回答1:



aspx.cs文件中:
protected void btn_Click(object sender, EventArgs e)
{
Response.Redirect("url=next.aspx");
}

其中的next.aspx要重新在当前项目上新建一个网页名,重命名为 next.aspx

回答2:



后台

protected void btnRedirect_Click(object sender, EventArgs e)
{
Response.Redirect("url");
}

回答3:

Response.Redirect(“这里写网页页面的地址”)
或者用js脚本 window.location.href='地址'

回答4:

Response.Redirect("页面路径");