Session 传值问题
我在girdview 上用js做了一个鼠标左击和右击事件,右击时打开一个页面,右击里打开另一个页面,可出现问题了,我点击后用JS打开的页面得不到Session["UserID"],用c#自己的函数打开的页面就能得到Session的值。以下是用JS打开而面的代码。各位大位救救小弟吧。
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string cellvalue = e.Row.Cells[6].Text;
string js = string.Format("window.open ('default.aspx?id=" +cellvalue + "') ");
e.Row.Attributes.Add("onclick", js);
string jss = "if(event.button == 2) window.open ('sale_edit.aspx?id=" + cellvalue + "')";
e.Row.Attributes.Add("onclick", js);
e.Row.Attributes.Add("onmousedown", jss);
//下面两句代码是添加鼠标效果,可以省略,当鼠标移动到行上时,变颜色
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFC0FF'");
//当鼠标离开的时候 将背景颜色还原的以前的颜色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
}
}