asp.net - call jquery dialog in gridview label mouseover -
how can fire jquery dialog asp.net gridview label mouse hover? tried doesn't work:
asp markup
<asp:gridview id="gvmain2" runat="server"> <columns> <asp:templatefield> <itemtemplate> <table class="tg-table-plain" style="width:100%"> <tr> <td><asp:label id="grid_lbl" class="grid_lbl" runat="server" text='<%# eval("some_text") %>'></asp:label> </td> </tr> </table> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
javascript
$(function () { $("#dialog").dialog({ autoopen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); $("#grid_lbl").hover(function () { $("#dialog").dialog("open"); }); });
the problem grid_lbl
not id of label in generated code because asp.net generates own ids. , since label inside gridview, setting clientidmode
or writing clientid
in javascript won't work here. should use class instead of id, classes same in generated code:
<asp:label id="grid_lbl" cssclass="grid_lbl_class" runat="server" text='<%# eval("some_text") %>'></asp:label> $(".grid_lbl_class").hover(function () { $("#dialog").dialog("open"); });
Comments
Post a Comment