C# 如何使用Jquery在Asp网格视图的项目模板中获取特定的项目?

C# 如何使用Jquery在Asp网格视图的项目模板中获取特定的项目?,c#,jquery,C#,Jquery,如何在特定的网格行上获得效果 <asp:GridView ID="gvSearch" runat="server" DataKeyNames="guidId" > <Columns> <asp:TemplateField> <ItemTemplate> <div class="test1"> "test paragraph" <

如何在特定的网格行上获得效果

<asp:GridView ID="gvSearch" runat="server" DataKeyNames="guidId" >
        <Columns>
          <asp:TemplateField>
           <ItemTemplate>
            <div class="test1"> "test paragraph"
            <img src="../Images/double-arrow.png" 
                 style="margin-left: 741px;margin- top:39px;"            
                 class="PreviewImage" 
                 onclick="DisplayImg('<%# Eval("guidId") %>')"/>
           </div>
          </asp:TemplateField>
        </Columns>
 </asp:GridView>
你可以试试这个

$('div.test1').mouseover(function () {
     //Hide all images which are visible.
     $('.PreviewImage:visible').hide();
     //On Mouse Over find the Image and show.
     $(this).find('.PreviewImage').show();
})
或者,如果使用jQuery版本>=1.6,也可以尝试

$('[Id$=gvSearch]').on('mouseover','div.test1',function () {
     //Hide all images which are visible.
     $('.PreviewImage:visible').hide();
     //On Mouse Over find the Image and show.
     $(this).find('.PreviewImage').show();
})
$('[Id$=gvSearch]').on('mouseover','div.test1',function () {
     //Hide all images which are visible.
     $('.PreviewImage:visible').hide();
     //On Mouse Over find the Image and show.
     $(this).find('.PreviewImage').show();
})