|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by justbeing in .NET Framework 2.x, Microsoft IIS Web Server
My .Net 2.0 application uses session variables to manage users being logged in and to know what should be displayed on certain pages. The application works perfectly locally. However, when published on the production server it does not work correctly.
It appears that the session variables are not being updated on the first pass through. The application updates the session. Then updates the a duplicate session record in the database. However, the application will be a step behind. I can look at the database in real time, and know that it is being updated at the right time, with the right information, but somehow the session is off. When the page is loaded it does not load the new question, but what was there previously.
This became a problem when the production servers were upgraded. Before, they supported .Net 1.1 and .Net 2.0. Now they only support .Net 2.0 and .Net 3.5. Any help would be greatly appreciated.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
|
protected void btnPrev_Click(object sender, EventArgs e)
{
try
{
if (lblProjID.Text != null)
{
cmd = new SqlCommand(qNotesSQL.getPrevResponse);
cmd.Parameters.AddWithValue("@respID", lblRespondentID.Text.ToString());
cmd.Parameters.AddWithValue("@quesID", lblQuestionID.Text.ToString());
cmd.Parameters.AddWithValue("@projID", int.Parse(lblProjID.Text.ToString()));
SqlDataReader dReader = util.getDataReaderForCmdObj(cmd);
if (dReader.HasRows)
{
clearFields();
dReader.Read();
string quesID = dReader[0].ToString();
//Set session variable QuestionID to the next question
((qData)Session["qnotes"]).QuestionID = quesID;
//Update session database record with the new QuestionID
cmd = new SqlCommand(qNotesSQL.updateSessionQuestion);
cmd.Parameters.AddWithValue("@Session", this.Session.SessionID);
cmd.Parameters.AddWithValue("@quesID", quesID);
cmd.Parameters.AddWithValue("@Now", System.DateTime.Now);
int temp = util.executeNonQueryForCmd(cmd);
dReader.Close();
//Reload the page
Response.Redirect("ResponseDetails.aspx", false);
}
}
}
catch (Exception exc)
{
string errMessage = "Source: " + exc.Source + "<BR /> " + "Message: " + exc.Message;
cmd = new SqlCommand(qNotesSQL.updateSessionError);
cmd.Parameters.AddWithValue("@error", errMessage);
cmd.Parameters.AddWithValue("@Now", DateTime.Now);
cmd.Parameters.AddWithValue("@Session", this.Session.SessionID);
int results = util.executeNonQueryForCmd(cmd);
((qData)Session["qnotes"]).errorMessage = errMessage;
Response.Redirect("Error.aspx", false);
}
}
|
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625