Cannot cause $(this).find("a").click(); to fire using JQuery
Posted
by Ali
on Stack Overflow
See other posts from Stack Overflow
or by Ali
Published on 2010-06-03T11:02:14Z
Indexed on
2010/06/03
11:04 UTC
Read the original article
Hit count: 753
Hi Everyone,
I have a small question which should be very easy for the jquery experts out there. I am trying to follow http://aspdotnetcodebook.blogspot.com/2010/01/page-languagec-autoeventwireuptrue.html to be able to perform an action on gridview row double click. I can redirect to another page fine (as shown in the example) but I cannot cause the $(this).find("a").click(); to fire. Below is my GridView markup.
<asp:GridView ID="gvCustomers" runat="server" DataSourceID="odsCustomers" CssClass="datagrid"
GridLines="None" AutoGenerateColumns="False" DataKeyNames="Customer_ID" PageSize="3"
AllowPaging="True" AllowSorting="True" OnRowCommand="gvCustomers_RowCommand"
OnRowDataBound="gvCustomers_RowDataBound">
<Columns>
<asp:BoundField DataField="Customer_ID" HeaderText="ID" ReadOnly="true" Visible="false" />
<asp:BoundField DataField="Customer_FirstName" HeaderText="First Name" ReadOnly="true" />
<asp:BoundField DataField="Customer_LastName" HeaderText="Last Name" ReadOnly="true" />
<asp:BoundField DataField="Customer_Email" HeaderText="Email" ReadOnly="true" />
<asp:BoundField DataField="Customer_Mobile" HeaderText="Mobile" ReadOnly="true" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkButton" runat="server" CommandName="showVehicles" CommandArgument='<%# Eval("Customer_ID") %>'
></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
Sorry No Record Found.
</EmptyDataTemplate>
</asp:GridView>
I just cant make it work as the author has suggested: /* or you could have a hidden LinkButton in the row (Text="" or not set) that you could trigger. Make sure you set the CommandName="Something" and CommandArgument="RecordId" */
on the OnCommand of linkButton, I have my server side method which I would like to fire. Any ideas will be most apprecited.
Thanks, Ali
© Stack Overflow or respective owner