0

I currently have a class of accounts that have 4 attributes and on one page I am performing math on one of the attributes, the balance, of the accounts. After doing the math I need to replace the current balance with the new balance in the session that I have saved for using on different pages and I can't figure it out for the life of me. I saved the session using

HttpContext.Current.Session["accountsSession"] = accounts;

and then I retrieve it using

List<Account> accounts = (List<Accounts>)Session["accountsSession"];

I can get the data and perform the math I just need to be able to update it.

Hunter
  • 77
  • 1
  • 10

1 Answers1

0

Sessions can be used across different pages, you will need to just set the same session again with your new values and all pages will read the new values.

Are you able to tell why did you use sessions on the first place? sessions probably not your ideal solution here!

if you can share more information about the problem you are trying to solve and what technology you are using will be good.

Ashraf
  • 66
  • 5