好吧,我想这个问题不言自明。这是一些代码(test.cs)使其更清晰:
while (reader.Read())
{
string sessieVak = reader["vak"].ToString();
if (variable == "cool")
{
//This part can only happen once in the entire application
HttpContext.Current.Session[sessieVak] = true;
}
if (HttpContext.Current.Session[sessieVak] != null)
{
str.Append("<li><a href = vak.aspx?id=" + reader["kdv_ID"] + " />" + reader["vak"] + "</a></li>");
}
}
我希望你们能帮助我。提前致谢。