关于ASP.NET一个gridview中获取ID值的一个问题?

来源:百度知道 编辑:UC知道 时间:2024/06/05 07:08:45
我想要调用gridview中的ID值以便传到下一个页面,现在的错误是不管点击哪个按钮ID值始终都是最后一条记录的ID值,不知道是哪里出错了,大家帮忙看看呀?
主页面:
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:GridView ID="GridView1" runat="server" DataKeyNames="id">
<Columns>
<asp:Templat

只是想把ID传到另外一个页面????
那用得着这么兴师动众的嘛!!!
<a href='****.aspx?id=<%#Eval("Id")%>'>

<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Edit" OnClick="LinkButton1_Click" Text="按钮"></asp:LinkButton>

</a>

<!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>
</head>
<body>
<form id="form1" runat="server">
<div><