在gridview的DataBound数据绑定时,在其中一列添加图片并且添加一个jquery方法,具体如下:
e.Row.Cells[1].Text = "<img src=\'Images/add.png\' style=\'border: dashed 0 red; width: 20;height: 20;\' onclick=\"ExpandBelow(\'" + strValue + "\',\'" + strText + "\')\" />" + e.Row.Cells[1].Text;但是在jquery方法ExpandBelow()中无法通过$(this).attr("src") 获取不到图片的地址,请大家指点下该如何获取图片地址,谢谢
e.Row.Cells[1].Text = "<img src=\'Images/add.png\' style=\'border: dashed 0 red; width: 20;height: 20;\' onclick=\"ExpandBelow(\'" + strValue + "\',\'" + strText + "\')\" />" + e.Row.Cells[1].Text;但是在jquery方法ExpandBelow()中无法通过$(this).attr("src") 获取不到图片的地址,请大家指点下该如何获取图片地址,谢谢
onclick = "ExpandBelow(this)"