下面的代码,我已经尝试过,没有显示任何东西。
Test1.aspx
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Test2.aspx?ID=1");
}Test2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test2.aspx.cs" Inherits="WebApplication5.test2" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text='<%=Request.QueryString["ID"] %>'></asp:Label>
</div>
</form>
</body>
</html>发布于 2010-06-18 03:25:13
在第二页的代码隐藏文件Page_Load event中,放置以下代码:
lblId.Text = Request.QueryString["ID"].ToString();其中lblId是第二页上的Label控件的ID。
这是克里斯。
https://stackoverflow.com/questions/3064891
复制相似问题