1

我有 TabControl(AjaxToolKit) 有 2 个嵌套的 ListViews。

代码:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:TabContainer ID="tcQuestions" runat="server" ActiveTabIndex="0"    OnDemand="true" AutoPostBack="false" TabStripPlacement="Top" ScrollBars="None" UseVerticalStripPlacement="false">
        <asp:TabPanel ID="tpFirst" runat="server" HeaderText="Page 1" Enabled="true" ScrollBars="Auto"
            OnDemandMode="Once">
            <ContentTemplate>
                <asp:Panel ID="pnlNoData" runat="server">
                    <asp:LinkButton ID="lbQuestionsAdd" Text="Add Question" runat="server" />    
                </asp:Panel>

                <asp:Panel ID="pnlListView" runat="server">
                    <asp:ListView ID="lsvQuestions" runat="server" ItemPlaceholderID="phItemPlaceHoler">
                        <EmptyDataTemplate>
                            <em>NO RECORD WAS FOUND</em>                            
                       </EmptyDataTemplate>
                       <ItemTemplate>
                            <tr>
                                <td>
                                    <asp:Label ID="lblQuestionID" Text='<%#Eval("intQuesId") %>' Visible="false" runat="server" />
                                    <asp:Label ID="lblQuestionTitle" Text='<%#Eval("strQuesTitle") %>' runat="server" />
                                    <%--1.Are you doing job?--%>
                                </td>
                            </tr>
                            <%--Inner Listview--%>
                            <asp:ListView ID="lsvAnswers" runat="server" ItemPlaceholderID="phItemPlaceHolerAnswers">
                                <LayoutTemplate>
                                    <table runat="server" id="table1">
                                        <tr runat="server" id="phItemPlaceHolerAnswers">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:PlaceHolder ID="plControl" runat="server" />
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <em>NO RECORD WAS FOUND</em>
                                </EmptyDataTemplate>
                            </asp:ListView>                            
                       </ItemTemplate>
                       <LayoutTemplate>
                            <table class="tblAll">
                                <tbody>
                                    <tr>
                                        <td style="width: 125px">
                                            <asp:LinkButton ID="lbtnAddQuestions" runat="server">Add Questions</asp:LinkButton>
                                        </td>
                                        <td style="width: 316px">
                                            <asp:LinkButton ID="lbtnDesignTools" runat="server">Design Tools</asp:LinkButton>
                                        </td>
                                        <td class="formTopLinks">
                                            <img class="imgicons" src="../Layout/images/edit.png" />
                                            <asp:LinkButton ID="lbEditProperties" runat="server" CssClass="lnkbuttonText">Edit Properties</asp:LinkButton>
                                        </td>
                                        <td class="formTopLinks">
                                            <img class="imgicons" src="../Layout/images/Delete.png" />
                                            <asp:LinkButton ID="lbCopyPage" runat="server" CssClass="lnkbuttonText">Copy Page</asp:LinkButton>
                                        </td>
                                        <td class="formTopLinks">
                                            <img class="imgicons" src="../Layout/images/Copy.png" />
                                            <asp:LinkButton ID="lbDeletePage" runat="server" CssClass="lnkbuttonText">Delete Page</asp:LinkButton>
                                        </td>
                                        <td style="width: 20px;">
                                            <img class="imgicons" src="../Layout/images/left.png" />
                                        </td>
                                        <td style="width: 64px;">
                                            <asp:Label ID="Label1" runat="server" CssClass="lnkbuttonText" Text="Move Page" />
                                        </td>
                                        <td style="width: 20px;">
                                            <img class="imgicons" src="../Layout/images/right.png" />
                                        </td>
                                        <td>
                                            &#160;
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <br />
                            <table class="tblAll">
                                <tbody>
                                    <asp:PlaceHolder ID="phItemPlaceHoler" runat="server"></asp:PlaceHolder>
                                </tbody>
                            </table>                            
                       </LayoutTemplate>
                  </asp:ListView>    
              </asp:Panel>                   
          </ContentTemplate>            
      </asp:TabPanel>
  </asp:TabContainer>

在哪里,我从表“问题”中得到问题,并从另一个表“答案”中得到答案。每个问题都与一个PageNumber.

所以,我必须TabPanels根据PageNumber问题创建,然后将问题标签与该问题绑定,并在第二个填写ListView该问题的答案。

这些答案是基于数据库条目的动态控件,例如textbox, checkboxlists,radiobutton lists并且可能因每个问题而异。

现在我正在做的是将 tabPanel 1 复制到 newTabPanel并根据 db 值添加问题和答案,但是当我创建 2nd 时TabPanel,它给了我错误

Cannot unregister UpdatePanel with ID 'ContentPlaceHolder1_tcQuestions_tpFirst_updatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.

处理这种场景的最佳方法是什么。

SurverMonkey 之类的东西,除了我使用新页面的标签。

4

0 回答 0