How to find the link button inside the ListView using jQuery
I am using ListView and i want to find the LinkButton using JQuery how is it possible
<asp:ListView ID="dlSearchListView" runat="server" >
<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<div class="right">
<div class="space1">
<asp:LinkButton ID="lnkbtnTell_a_Friend" runat="server" Text="Tell a Friend" CssClass="PropertyLinkButtons"></asp:LinkButton>
开发者_如何学Python </div>
<div class="space1">
<asp:LinkButton ID="lnkbtnEmail_Owner" runat="server" Text="Email Owner" CssClass="PropertyLinkButtons"></asp:LinkButton>
</div>
<div class="space1">
<asp:LinkButton ID="lnkView" runat="server" Text="View" CommandName="View" CssClass="PropertyLinkButtons"></asp:LinkButton>
</div>
</div>
</div>
</ItemTemplate>
</asp:ListView>
Now how can i find the link button "lnkbtnTell_a_Friend" using Jquery
Thanks in advance Vara Prasad.M
The simplest/cleanest way is to give it an additional class, just change it's CssClass
like this:
CssClass="PropertyLinkButtons FriendButton"
then in jQuery use a .class
selector:
$(".FriendButton").doSomething();
Otherwise you could find them by ID and an attribute-contains selector, but it's much slower:
$("a[id*='lnkbtnTell_a_Friend']").doSomething();
精彩评论