后端代码如下:
Session["chars"] = this.DropChar.SelectedItem.ToString();
Session["para"] = this.DropPara.SelectedItem.ToString();
Session["enery"] = enery;
Session["fromtime"] = StartTime1.Text;
Session["totime"] = EndTime1.Text;
前端代码如下:
var enery = "";
var para = "";
var time = "";
var fromtime = "";
var totime = "";
var fromto = fromtime.toString() + '-' + totime.toString()
这样来获取到对应的session里面的属性值
还有另外一种写法,配合input表单来使用
" />
需要注意的是此时的input表单为隐藏表单