asp.net GridView跳转到本页的另一个panel怎么实现
1个回答
展开全部
前台页面gridview里面设置
<asp:ButtonField Text="选择" DataTextField="数据库字段" HeaderText="标题" CommandName="Select">
</asp:ButtonField>
后台
protected void GridView1_RowCommand(object source, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
int i = Convert.ToInt16(e.CommandArgument.ToString());
string ID = this.GridView1.Rows[i].Cells[0].Text;
Response.Write("<script language=javascript>parent.location.href='跳转页面.aspx?获取参数=" + ID + "';</script>");
}
}
<asp:ButtonField Text="选择" DataTextField="数据库字段" HeaderText="标题" CommandName="Select">
</asp:ButtonField>
后台
protected void GridView1_RowCommand(object source, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
int i = Convert.ToInt16(e.CommandArgument.ToString());
string ID = this.GridView1.Rows[i].Cells[0].Text;
Response.Write("<script language=javascript>parent.location.href='跳转页面.aspx?获取参数=" + ID + "';</script>");
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询