Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
pass value from one page to other
Imran Bashir
Jul 27 2016 8:49 AM
255
Reply
Hello guys i'm using the session to pass value from one page to other i have two page one is
sale
and one is
purchase
these value response.redirect(ledger.aspx) page and here i can save value in textbox but when i visit both of these page session both of them have been create and in ledger page if condition fails to check the last request of page becoz both of them have session ..kindly tell me how do i can check if condition only work on last page request
Session["SaleInfo"]
Session["PurchaseInfo"]
====================here is the code ================================
protected void Page_Load(object sender, EventArgs e)
{
dbclass db = new dbclass();
//TxtPartyId.Text = Request.QueryString.ToString();
string p;
string s;
int temp = 0;
if (Session["SaleInfo"] != null)
{
s = Session["SaleInfo"].ToString();
temp = 1;
}
else if (Session["purchaseInfo"] != null)
{
p = Session["purchaseInfo"].ToString();
temp = 2;
}
switch (temp)
{
case 1:
TxtVoucherID.Text = Session["SaleID"].ToString();
string id = Session["PartID"].ToString();
TxtPartyId.Text = Session["PartName"].ToString();
txtTotalAmount.Text = Session["TotalAmount"].ToString();
txtPaid.Text = Session["Paid"].ToString();
txtBlance.Text = Session["Balance"].ToString();
txtDate.Text = Session["SaleDate"].ToString();
break;
case 2:
TxtVoucherID.Text = Session["PurchaseID"].ToString();
string id2 = Session["PartID"].ToString();
TxtPartyId.Text = Session["PartName"].ToString();
txtTotalAmount.Text = Session["TotalAmount"].ToString();
txtPaid.Text = Session["Paid"].ToString();
txtBlance.Text = Session["Balance"].ToString();
txtDate.Text = Session["PurchaseDate"].ToString();
break;
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to mvc use entity framework in login code
what the tool in asp.net like fieldset