问题描述
嗨,在此功能中,我使用了ReorderList。我有一个“编辑”链接按钮,该按钮显示一个带有文本框的面板,允许我编辑“重新订购列表”中的一项。在文本框所在的“重新排序列表”和“面板”中定位控件时遇到问题。简而言之,我想选择一个项目上的“编辑”链接,然后它将弹出面板,其中包含我选择的项目中的文本。打开后,我要编辑文本并将其保存到“重新排序列表”和“数据库”中。
```<div style="color: Black" class="ajaxOrderedList">
<ajaxToolkit:ReorderList runat="server" ID="ReorderList1" DataSourceID="sqlComments" DataKeyField="RecNo" SortOrderField="CommentOrder" AllowReorder="true" PostBackOnReorder="true">
<ItemTemplate>
<div style="border:1px solid black; padding:5px 0px 5px 5px;">
Program <asp:Label ID="lblProgram" runat="server" Text='<%# Eval("ProgramNumber")%>'></asp:Label>:
<asp:Label ID="lblComment" runat="server" Text='<%# Eval("Comment")%>'></asp:Label>
<asp:LinkButton runat="server" ID="lnkEditComment" Text="Edit" OnClick="lnkEditComment_Click"></asp:LinkButton>
<ajaxToolkit:ModalPopupExtender ID="modalPopup" runat="server" PopupControlID="pnlCommentInfo" TargetControlID="lnkEditComment" BackgroundCssClass="modalBackground" CancelControlID="btnCancel"></ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="pnlCommentInfo" runat="server" Style="display: none; text-align: left" CssClass="pnlPop" BorderStyle="Double" Width="500px" ScrollBars="Auto">
<asp:Label runat="server" ID="lblCommentNumber"></asp:Label><br />
<br />
Comment:<br />
<asp:TextBox ID="txtEditComment" runat="server" Rows="6" TextMode="MultiLine" Columns="58" /><br />
<br />
<asp:Button ID="btnSave" runat="server" Text="Save" CausesValidation="false" CommandName="Update" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" />
</asp:Panel>
<asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete">Delete</asp:LinkButton> </div>
</ItemTemplate>
<DragHandleTemplate>
<div style="width: 15px; height: 16px; background-image: url(images/icons/drag.png); background-repeat: no-repeat; cursor: move; border: outset thin white; padding: 2px; background-position: center;">
</div>
</DragHandleTemplate>
<ReorderTemplate>
<div style="width: 99%; border: dashed 2px #999999;">
</div>
</ReorderTemplate>
</ajaxToolkit:ReorderList>
</div>
</asp:Panel>```
这是我的代码背后:
{
//Add code to copy the current comment from the reorderedlist to the Edit Popup Box
TextBox newEdit = (TextBox)ReorderList1.FindControl("_rliInsert").FindControl("txtEditComment");
Label progr = (Label)ReorderList1.FindControl("_rliInsert").FindControl("lblProgram");
Label curComment = (Label)ReorderList1.FindControl("_rliInsert").FindControl("lblComment");
newEdit.Text = "Program " + progr.Text + ": " + curComment.Text;
}```
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)