且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用值传递到另一个页面SESSIONS

更新时间:2022-05-09 22:22:28

背后的Default.aspx code

Code behind default.aspx

   protected void ConfirmButton_Click(object sender, EventArgs e)
{

Session["Sales"] = txtSalesPrice.Text;

Session["Amt"] = lblDiscountAmount.Text;

Session["Total"] = lblTotalPrice.Text;
Response.Redirect("Confirm.aspx");
}

和你这样的另一个页面获得价值
在的.cs

And you get value in another page like this In .cs

txtSales.text = Session["Sales"];

在的.aspx

 <asp:TextBox ID="txtSales" runat="server" Text='<%# Session["Sales"] %>' >