<asp:HyperLinkColumn HeaderText="入库" DataNavigateUrlField="ID" DataNavigateUrlFormatString="javascript:PutIn({0},this)" Text="&lt;img src=../Images/folder_into.gif border=0&gt;" Visible="true" >
                            <HeaderStyle Width="40px" />
                        </asp:HyperLinkColumn>一个DataGrid里这样一列 调用一个function PutIn(objId, obj)函数  我是用的jquery  
然后这个this 怎么处理勒??? 我想获得他的绝对位置  $(obj).position().top这样子不行   但是我调试了 传过来的obj不为空 谁较下我怎么获取绝对位置???

解决方案 »

  1.   

    传过来了this啊
    你看上面那个HyperLinkColumn 里面的DataNavigateUrlFormatString嘛
      

  2.   

    你在function PutIn(objId, obj)里面alert(obj)出来看看是什么~
      

  3.   

    嗯 这是alert出来的东西: [object Window]      
      

  4.   

    那不就对了~~你压根就没有传进去正确的对象
    DataNavigateUrlFormatString里面调用this是不行的
    DataNavigateUrlFormatString="javascript:void(0);"
    onclick="PutIn(id,this)"才行
      

  5.   

    那告诉我怎么传参? 但是我调试  传过来的this 我监视他 length为1啊
      

  6.   

    你压根就不能使用href=""来做这件事
      

  7.   

    javascript:void(0);" 返回flase用onclick事件  不要用href=""