在c#.ne开发中:
在1.aspx中有js:
<script>
  function show_detail(thisID){
  window.open("2.asp?id=" +thisID);
  }
</script>
               
在1.aspx.cs中
 lable1.Text = dd["id"].ToString();
 this.lable1.Attributes.Add("onclick", "show_detail(this)"); 如何实现在1.aspx中 dd["id"].ToString()值传到2.asp。我这个始终不对?

解决方案 »

  1.   

    window.open("2.asp?id=" +thisID.value);
     应该是这样吧  不行的话你再试试thisID其他的属性值
      

  2.   

    this.lable1.Attributes.Add("onclick", "show_detail("+this.UniqueID.ToString()+")"); 
      

  3.   

    this.lable1.Attributes.Add("onclick", "show_detail("+this.lable1.UniqueID.ToString()+")");你是想传lable1的ID过去吧?
      

  4.   

    this.lable1.Attributes.Add("onclick", "show_detail("+dd["id"].ToString()+")"); 
    然后
    window.location.href="2.asp?id="+thisID.value; 
      

  5.   

    不对,是this.lable1.Attributes.Add("onclick", "show_detail('"+dd["id"].ToString()+"')"); 
      

  6.   

    不好意思,这里不需要value,如下就可以了
    window.location.href="2.asp?id="+thisID;