我的代码是
<asp:DataList EnableTheming="false" ID="dlDocument" ShowHeader="false" ShowFooter="false"
RepeatColumns="3" runat="server" OnItemCommand="dlDocument_ItemCommand" DataKeyField="Id"
RepeatDirection="Horizontal" OnItemDataBound="dlDocument_ItemDataBound">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" dir="ltr" align="center">
<tr>
<td class="C2-TL"></td>
<td class="C2-TM"></td>
<td class="C2-TR"></td>
</tr>
<tr>
<td class="C2-LM">
</td>
<td class="C2-Content">
<table width="110" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center" valign="top" width="14">
<asp:ImageButton ToolTip="ویرایش" ID="btnUpdate" CommandName="Update" runat="server" Height="12px" OnClientClick="editDocList(<%#((Document)Container.DataItem).Id%>)"
Width="12px" ImageUrl="/App_Themes/Default/Images/GridIcons/Grid-Edit.png" />
<br />
<asp:ImageButton ToolTip="حذف" OnClientClick="javascript:return confirm('آیا مطمئن به حذف هستید؟');return false;"
ID="btnDelete" CommandName="Delete" runat="server" Height="12px" Width="13px"
ImageUrl="/App_Themes/Default/Images/GridIcons/Grid-delete.png" />
</td>
<td align="center" rowspan="2">
<asp:Label ID="lblImg" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td align="center" valign="top" width="16">
<a href="javascript:" title="چاپ تصویر در اندازه A4" onclick='SendToPrint("<%#"/Handlers/ImageHandler.ashx?id=" +((Document)Container.DataItem).Id%>");'>
<img alt="چاپ تصویر" src="<%=Radyn.Contracts.Application.Settings.DNNPath %>/Images/GridIcons/print.png" border="0" height="16"
width="16" />
</a>
</td>
</tr>
<tr>
<td width="14"></td>
<td align="center" height="25">
<asp:Label ID="lblDesc" runat="server"></asp:Label>
</td>
</tr>
</table>
</td>
<td class="C2-RM">
</td>
</tr>
<tr>
<td class="C2-BL2"></td>
<td class="C2-BM2"></td>
<td class="C2-BR2"></td>
</tr>
</table>
</ItemTemplate>
问题是当我点击图像按钮编辑或删除第一次点击没有触发itemcommand事件,但在第二次点击火灾
我在usercontrol(.ascx)中有这个数据表 数据列表在 的Default.aspx ==&GT; view.ascx ==&GT; docLink.asx
我在window.open中调用default.aspx
答案 0 :(得分:0)
例如我的控件是Doclist 我添加了Doclist.ID =“docList”;
问题解决了