I have built a web application with Visual Studio using C# and a small sample of the code looks like the following:
private string isbn; // at class level
private int total;
on_page_load() {
if (!IsPostback) {
if (Session["ISBN"] != null && Session["total"] != null) {
this.isbn = Convert.ToString(Session["ISBN"]);
this.total = Convert.ToInt32(Session["total"]);
}
}
}
The session variables are stored "InProc" and the page is transfered from main.aspx (after storing Session["ISBN"] = "9-999-9-9" and Session["total"] = 1) via Server.Transfer("new_page.aspx"
.
When the user "clicks" a button on this page the isbn and total values are displayed. Sometimes the isbn value is correct, sometimes it is not. The total value always has the correct value. Has anybody out there ran into this same kind of problem? If so, what did you do to solve it. I have been thinking that there may be issues with the way the "Convert" object translates the Session object to a string value versus an integer value but am unsure. Any help/hints would be great. Thanks to anybody that can help.
private string isbn; // at class level
private int total;
on_page_load() {
if (!IsPostback) {
if (Session["ISBN"] != null && Session["total"] != null) {
this.isbn = Convert.ToString(Session["ISBN"]);
this.total = Convert.ToInt32(Session["total"]);
}
}
}
The session variables are stored "InProc" and the page is transfered from main.aspx (after storing Session["ISBN"] = "9-999-9-9" and Session["total"] = 1) via Server.Transfer("new_page.aspx"
When the user "clicks" a button on this page the isbn and total values are displayed. Sometimes the isbn value is correct, sometimes it is not. The total value always has the correct value. Has anybody out there ran into this same kind of problem? If so, what did you do to solve it. I have been thinking that there may be issues with the way the "Convert" object translates the Session object to a string value versus an integer value but am unsure. Any help/hints would be great. Thanks to anybody that can help.