ajax怎么实现浏览记录,怎么用AJAX做页面的浏览历史记录?
问题补充:protected void Page_Load(object sender, EventArgs e){if (!IsPostBack){if (Request.QueryString["lineInfoId"] == "" || Request.QueryString["lineInfoId"] == null){Response.Redirect("TravelAround.asp
问题补充:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["lineInfoId"] == "" || Request.QueryString["lineInfoId"] == null)
{
Response.Redirect("TravelAround.aspx");
}
else
{
lineInfoid = Request.QueryString["lineInfoId"];
Response.Cookies.Add(new HttpCookie("bindShow",Request.QueryString["lineInfoId"]));
}
}
if (Request.Cookies["bindShow"].Value != "")
{
lineIdCount = lineIdCount + "," + Request.Cookies["bindShow"].Value;
HistoryRestore(lineIdCount);
}
}
private void HistoryRestore(string showID)
{
Response.Cookies.Add(new HttpCookie("lineID", showID));
if (Request.Cookies["lineID"] != null)
{
string tempStr = Request.Cookies["lineID"].Value;
string shwid = string.Empty;
string[] str = tempStr.Split(',');
for (int i = 1; i <= str.Length; i++)
{
if (i >= str.Length - 1)
{
if (shwid == "")
{
shwid = str[i - 1];
}
else
{
shwid += "," + str[i - 1];
}
}
}
string sqlSelct = "select LineTitle,HistoryImage,LinePrice,AllRoute From LineInfo where LineInfoId in(" + shwid + ")";
rpthistory.DataSource = DbSqlHelper.ExecuteDataSet(sqlSelct).Tables[0];
rpthistory.DataBind();
}
}
这是我现在写的代码,可是它把别个点击的商品也显示我的电脑上面了
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)