我用document.getElementById('img_thisPice').scrollIntoView()来定义锚点  可是:  Microsoft JScript 运行时错误: 'document.getElementById(...)' 为空或不是对象    'img_thisPice'为asp:image的id名我把('img_thisPice')换成(\"img_thisPice\") 也不行  请高手帮帮忙!

解决方案 »

  1.   


    .net Web 控件在生成页面后在客户端的ID是和控件ID不一样的,你需要取 asp:image控件的ClientId名。象document.getElementById('<%=img_thisPice.ClientID%>').scrollIntoView();
      

  2.   

    感谢您的回答  但是
    document.getElementById('<%=img_thisPice.ClientID%>').scrollIntoView(true)  也不行啊 说的也是一样的错  
      

  3.   

    document.getElementById(' <%=img_thisPice.ClientId%>').scrollIntoView() 也不行。
    求高人指点!!
      

  4.   

    你一定是用了模板页,解决方案,运行你的页面,右键,查看源文件,找到控件的ID,有可能 ID会是这样的格式
    <img id="ctl00_GridView1_ctl04_Image1" src="images/arrow_1.gif" style="border-width:0px;" />