我在用户控件(ascx)文件中使用此脚本:
<script type="text/javascript">
function ShowPopUp() {
var id1 = window.$find('<%=ModalPopupExtender1.ClientID %>');
id1.show(); }
</script>
弹出窗口编码在这里:
<asp:TextBox ID="txtCosCodeExpCode" runat="server" CssClass="SVSTableCellTextBox1" ></asp:TextBox>
<cc1:modalpopupextender id="ModalPopupExtender1" runat="server" targetcontrolid="txtCosCodeExpCode" popupcontrolid="Panel1" backgroundcssclass="ModalPopupBG"></cc1:modalpopupextender>
单击“确定”按钮时,应执行以下操作:
ModalPopupExtender1.Hide();
txtCosCodeExpCode.Text = ReturnCostCentreExpCode();
包含所有这些内容的用户控件在同一页面上重复10次:
<uc1:OrderLineControl ID="OrderLineControl1" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl2" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl3" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl4" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl5" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl6" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl7" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl8" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl9" runat="server" />
<uc1:OrderLineControl ID="OrderLineControl10" runat="server" />
因此,当我使用tab键将光标移动到字段txtCosCodeExpCode时,它会打开Popup。我可以进行选择并单击“确定”。但是,当单击OK按钮时,它正在更新WRONG txtCosCodeExpCode,即如果我正在编辑第2行或第3行,它会将新值粘贴在第10行。