C# 响应。重定向到Div

C# 响应。重定向到Div,c#,asp.net,C#,Asp.net,我有这个代码重定向到一个新的aspx页面 protected void OrdersGrid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string orderId= DataBinder.Eval(e.Row.DataItem, "orderId").ToStrin

我有这个代码重定向到一个新的aspx页面

protected void OrdersGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string orderId= DataBinder.Eval(e.Row.DataItem, "orderId").ToString();
            string Location = "test.aspx" + "?OrderID=" + orderId;
            Response.Redirect(Location);
            e.Row.Attributes["onClick"] = string.Format("javascript:window.location='{0}';", Location);
            e.Row.Style["cursor"] = "pointer";
            test.Attributes["style"] = "visibility:visible;display:block;";
        }
    }
代码运行良好
我想知道是否可以将
Response.Redirect
中的页面(test.aspx)替换为div#id
我需要在第二个div中使用orderId,以便在同一页面中显示订单详细信息。
我知道我可以使用其他方法检索orderId,但我使用上述代码将GridView中的整行作为链接

谢谢

不,你不能“重定向”到div。这个概念毫无意义。你到底想做什么?你想用来自服务器的数据更新div吗?@KirkWoll谢谢你的回答。我想从gridview中检索orderId并在第二个div中使用它。我可以使用“Response.Redirect”来实现这一点,但不能使用div。这是因为您无法重定向到div。重定向用于更改URL。你将在同一个URL上。尝试只更新div的标记,而不是重定向。顺便说一下,调用Response.Redirect()后的任何代码都不会运行。