我将以下代码添加到转发器...
<input type="image" style="border-width:0" alt="Edit Reviewer Group"
title="Edit Reviewer Group" tabindex="0"
src='<%=ResolveUrl("~/css/images/icon_edit.png") %>'
onclick='showNewRevewerGroupModalPanelNew(<%#DataBinder.Eval(Container.DataItem,"Id")%>,
<%#HttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "Name"))%>);
return false;' />
在上述添加之后...编辑按钮不再弹出弹出框...我将其隔离到“名称”列。在对 showNewRevewerGroupModalPanelNew 的调用中包含 Name 列后,当在转发器行中按下编辑图标时,模式弹出窗口停止触发....感谢您的帮助!
function showNewRevewerGroupModalPanelNew(Id, Name)
{
alert(Id);
//$find('RevListModalPopupBehavior').show();
}
</script>
<asp:Repeater ID="rptReviewerList" runat="server" OnItemCommand="_Command">
<HeaderTemplate>
<ul class="standardList">
<li class="listHeader">
<p class="revListTitle">Name</p>
<p class="number">Number of Reviewers</p>
<p class="date">Last Modified</p>
<p class="edit"> </p>
</li>
</HeaderTemplate>
<ItemTemplate>
<li <%#Container.ItemIndex%2==0? "class='bg1'" : "" %>>
<p class="revListTitle"><%#HttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem,"Name"))%></p>
<p class="number"><%#DataBinder.Eval(Container.DataItem,"ReviewerCount")%></p>
<p class="date"><%#String.Format("{0:d}",DataBinder.Eval(Container.DataItem, "Modified"))%></p>
<p class="edit">
<asp:ImageButton ID="imgBtnUpdate" runat="server" ImageUrl="~/css/images/icon_update.png"
Tooltip="Update Reviewer List" AlternateText="Update Reviewer List"
CommandName="UpdateRevList"
CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>'/>
<input type="image" style="border-width:0" alt="Edit Reviewer Group"
title="Edit Reviewer Group" tabindex="0"
src='<%=ResolveUrl("~/css/images/icon_edit.png") %>'
onclick='showNewRevewerGroupModalPanelNew(<%#DataBinder.Eval(Container.DataItem,"Id")%>,
<%#HttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "Name"))%>);
return false;' />
<asp:ImageButton ID="imgBtDelete" runat="server" ImageUrl="~/css/images/icon_remove.png" Tooltip="Remove Reviewer List" AlternateText="Remove Reviewer List" CommandName="DeleteRevList" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>' />
<cc1:ConfirmButtonExtender ID="cbxDelete" runat="server" TargetControlID="imgBtDelete" ConfirmText='<%# makeDeleteText(DataBinder.Eval(Container.DataItem, "Name").ToString()) %>'/>
</p>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ibtOK"/>
<asp:PostBackTrigger ControlID="importBtn"/>
<asp:PostBackTrigger ControlID="editBtn"/>
</Triggers>
</asp:UpdatePanel>
这是 Firebug 告诉我的 ReferenceError:“ABCD”未定义。但 ABCD 是中继器行中“名称”的值。中继器中输入块的运行时间值为:
<input type="image" style="border-width:0" alt="Edit Reviewer Group"
title="Edit Reviewer Group" tabindex="0"
src='/css/images/icon_edit.png'
onclick='showNewRevewerGroupModalPanelNew(4,
ABCD);
return false;' />