jQuery - Get value of hyperlink.navigateurl
I bind click to a series of asp:hyperlink
via the following jquery
$(".dummyIdentifier").click(function () {
$("#divLineItemComments").dialog("open");
return false;
});
This works fine. Now, I need to pass the value of Hyperlink.NavigateUrl OnClick
. So that I may include the values with ajax $.get()
How can I get the value of a clicked hyperlink? I do not know it'开发者_开发百科s ID as the hyperlinks are generated dynamically along with their names by ASP.NET.
<asp:TemplateField HeaderText="Notes" ItemStyle-CssClass="NoMargin NoPadding" SortExpression="lineNotes">
<ItemTemplate>
<asp:HyperLink id="notesHl" runat="server" text='<%# Bind("lineNotes") %>' Font-Underline="true" Font-Bold="true" CssClass="dummyPhysicalNoteIdentifier"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Font-Size="Smaller" Height="10px" Width="10px" Wrap="True" />
</asp:TemplateField>
You can do it like this:
$(".dummyIdentifier").click(function () {
$("#divLineItemComments").dialog("open");
var url = $(this).attr('href');
return false;
});
精彩评论