<a href="Xt_yongfu_Xg.asp?id=<%=(Recordset1.Fields.Item("ID").Value)%>"><img src="images/edt.gif" width="16" height="16" border="0" /></a>请问我要把上面这个ASP代码改用下面这样子实现,但不知道怎么传递id,请高手帮忙写一下。function Xg()
{
window.location.href="Xt_yongfu_Xg.asp"
}<a href="javascript: Xg();"><img src="images/edt.gif" width="16" height="16" border="0" /></a>

解决方案 »

  1.   


    function Xg() 

    window.location.href="Xt_yongfu_Xg.asp?id=" +"<%=(Recordset1.Fields.Item("ID").Value)%>";

      

  2.   

    function Xg(idval) 

    window.location.href="Xt_yongfu_Xg.asp?id="+idval 
    } <a href="javascript: Xg(<%=(Recordset1.Fields.Item("ID").Value)%>);"> <img src="images/edt.gif" width="16" height="16" border="0" /> </a>
      

  3.   

    可这个id是重复区域里面的,就是说有好多id,我点这条数据后面的链接能传递这条记录的id才行,不然点哪条记录传递的id都是一样的,可不行。
      

  4.   

    function Xg() 

    window.location.href="Xt_yongfu_Xg.asp?id=" +"<%=(Recordset1.Fields.Item("ID").Value)%>";
      

  5.   

    function Xg(sid)
    {
    window.location.href="Xt_yongfu_Xg.asp?id=" +sid ;
    }
    <a href="javascript: Xg(<%=(Recordset1.Fields.Item("ID").Value)%>);"><img src="images/edt.gif" width="16" height="16" border="0" /></a>这样就实现了,呵呵