I have a situation where a user can open more than 1 tab or page to pull up different reports. When they pull up the report from a.aspx I pass the data to b.aspx via a session variable and it loads b.aspx just fine. The problem I am having is that since the session variable exists across all the pages if they hit refresh on any of the report pages, copies of b.aspx, they get the latest report they tried to open from a.aspx. How can I have a session variable or possibly a GET or POST upon refresh of b.aspx that only stays for that particular b.aspx? Right now on the calling page a.aspx.cs

HttpContext.Current.Session["CHART"] = "chartname";

And on the receiving page b.aspx.cs,

string chart = HttpContext.Current.Session["CHART"].ToString();
有帮助吗?

解决方案

Use Querystring for this instead of session. It looks like you are just passing a string value (chartname) to the other page. You won't have the problem with refresh with querystrings.

So pass it as b.aspx?Chart="chartname".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top