前台js改变Session的值(用ajax实现)_javascript技巧
时间:2021-07-01 10:21:17
帮助过:4人阅读
首先,html代码:
代码如下:
js代码:
代码如下:
var compareContent=”你要改变的值";
if (compareContent != "") {
document.getElementById("compareIframe").src = "ajax/changeSession.aspx?compareInfo=" +compareContent;
}
ajax:
changeSession.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
Session["compare"] = Request.QueryString["compareInfo"];
}
//end
//