展开全部
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>
<script language=javascript>
function keyDown()
{
var keycode=event.keyCode;
if(keycode==13)
event.keyCode=65;
}
document.onkeydown=keyDown;
</script>
</head>
<body>
<form id="form1" runat="server" action="no.aspx">
<div>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
<asp:Button ID="Button1" runat="server" AccessKey="A" Text="Button" OnClick="Button1_Click" /></div>
</form>
</body>
</html>
================
在Default.aspx.cs里写
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("http://zhidao.baidu.com/");
}
试试能不能解决!!
<!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>
<script language=javascript>
function keyDown()
{
var keycode=event.keyCode;
if(keycode==13)
event.keyCode=65;
}
document.onkeydown=keyDown;
</script>
</head>
<body>
<form id="form1" runat="server" action="no.aspx">
<div>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
<asp:Button ID="Button1" runat="server" AccessKey="A" Text="Button" OnClick="Button1_Click" /></div>
</form>
</body>
</html>
================
在Default.aspx.cs里写
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("http://zhidao.baidu.com/");
}
试试能不能解决!!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询