No more than 1 Pager on the same page

2 posts, 0 answers
  1. Marco Crea
    Marco Crea avatar
    2 posts
    Member since:
    Mar 2008

    Posted 23 Nov 2010 Link to this post

    Hi,
    in my page I have a multipage with 2 page, and for each page I have 2 list related by code, the second one list has a radpager conteined only one slider field. In runtime when I switch from first tab to second tab and click on first list to load the second one I receive a client error in IE:
    A control is already associated with the element.

    In others word I can't use 2 pager (slider) in the same page.

    Thanks,
    Marco

    <telerik:RadTabStrip runat="server" ID="RadTabStrip1"
        Skin="Office2007" MultiPageID="RadMultiPage1" EnableEmbeddedSkins="False"
                >
        <Tabs>
            <telerik:RadTab Text="Noleggio" >
            </telerik:RadTab>
            <telerik:RadTab Text="Vendita" >
            </telerik:RadTab>                   
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="RadMultiPage1"  Height="680px"
        Width="1005px" CssClass="multiPage"  >
        <telerik:RadPageView runat="server" ID="RadPageView1"
            CssClass="noleggioHwPageView" >
     
            <telerik:RadAjaxLoadingPanel ID="ldPnlNoleggioHW" runat="server" Skin="Office2007">
            </telerik:RadAjaxLoadingPanel>
             
             
            <telerik:RadListView ID="lstCategorieNoleggio" runat="server" DataSourceID="XmlDataSource1"
                ItemPlaceholderID="PlaceHolder2" AllowPaging="false" OnSelectedIndexChanged="lstCategorieNoleggio_SelectedIndexChanged">
                <LayoutTemplate>
                    <div class="NoleggioHwbar" >
                        <asp:Panel ID="NoleggioPanel" runat="server">
                            <div class="NoleggioHw">
                                <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
                            </div>            
                            </asp:Panel>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <div class="category">
                        <h3>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("titolo") %>'/>
                            <asp:HiddenField ID="Label2" runat="server" Value='<%# Bind("categoriaid") %>'/>
                        </h3>
                         <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl='<%# "../" + Eval("image") %>'
                                        AlternateText='<%# Eval("descrizione") %>' CommandName="Select" />
                        <p>
                            <%# Eval("descrizione")%>
                        </p>
                   </div>
                </ItemTemplate>
                <SelectedItemTemplate>
                    <div class="selected">
                        <h3>
                            <%# Eval("titolo")%>
                        </h3>
                        <asp:Image ID="SushiImage2" runat="server" AlternateText='<%# Eval("descrizione") %>'
                            Width="140px" ImageUrl='<%# "../" + Eval("image") %>' />
                        <p>
                            <%# Eval("descrizione")%>
                        </p>
                    </div>
                </SelectedItemTemplate>
            </telerik:RadListView>
             
                <asp:Panel ID="pnlDettaglioNoleggio" runat="server" Visible="false">
                <telerik:RadListView ID="lstProductNoleggio" runat="server"
                    ItemPlaceholderID="ProductsNoleggioContainer" OnDataBound="lstProduct_DataBound"
                    AllowPaging="true" DataKeyNames="IDProdotto" PageSize="4"
                    OnNeedDataSource="lstProductNoleggio_NeedDataSource">
                    <LayoutTemplate>
                            <asp:PlaceHolder ID="ProductsNoleggioContainer" runat="server"></asp:PlaceHolder>
     
                            <table cellpadding="0" cellspacing="0" border="0" width="100%;" style="clear: both;">
                                <tr>
                                    <td align="left">
                                        <telerik:RadDataPager ID="RadDataPagerNoleggio" Skin="Vista"  runat="server" PagedControlID="lstProductNoleggio"
                                            PageSize="4">
                                            <Fields>
                                                 <telerik:RadDataPagerSliderField  SliderIncreaseText="Più" SliderDecreaseText="Meno"
                                                  SliderDragText="Trascina" />                                               
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </td>
                                </tr>
                            </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <table  style="float:left; width: 478px; height: 150px; background-color:White; margin:2px 2px 2px 2px">
                            <tr>                                       
                                <td>                                       
                                    <div class="photo-container-noleggio">
                                        <asp:Image ID="imgProdottoNoleggio" runat="server" AlternateText='<%# Eval("NomeProdotto") %>'
                                            Width="100px" Height="100px" ImageUrl='<%# "../" + Eval("FotoPath") %>' />
                                    </div>
                                </td>
                                <td>
                                    <div class="detailsNoleggio">                                       
                                        <div class="data-container-noleggio">
                                            <ul>
                                                <li>
                                                   Marca: <label><%#Eval("Marca")%></label>
                                                </li>
                                                <li>
                                                    Modello: <label><%#Eval("NomeProdotto")%></label>
                                                </li>
                                                <li>
                                                    Canone mensile: <label> <%#((decimal) Eval("PrezzoNoleggio")).ToString("N2") %></label>
                                                </li>
                                                <li>
                                                   Modello: <label><%#Eval("Descrizione")%></label>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                                <td valign="top">
                                    <div class="document">          
                                         <asp:HyperLink Text=""  ID="ImageDocN" runat="server" AlternateText="" Visible='<%# Eval("DocumentPath").ToString() != ""%>'
                                                    SkinID="ImgPdf32"  NavigateUrl='<%# Eval("DocumentPath").ToString() == "" ? "#" : "../" + Eval("DocumentPath") %>' />
                                    </div>
                                </td>                                   
                            </tr>                               
                        </table>
     
                    </ItemTemplate>
                </telerik:RadListView>
             
            </asp:Panel>
             
              
        </telerik:RadPageView>
                        <telerik:RadPageView runat="server" ID="RadPageView2"
            CssClass="venditaHwPageView" meta:resourcekey="RadPageView2Resource1">
             
            <telerik:RadAjaxLoadingPanel ID="ldPnlVenditaHW" runat="server" Skin="Office2007">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadListView ID="lstCategorieVendita" runat="server" DataSourceID="XmlDataSource1"
                ItemPlaceholderID="PlaceHolder3" AllowPaging="false" OnSelectedIndexChanged="lstCategorieVendita_SelectedIndexChanged">
                <LayoutTemplate>
                    <div class="NoleggioHwbar" >
                        <asp:Panel ID="VenditaPanel" runat="server">
                            <div class="NoleggioHw">
                                <asp:PlaceHolder ID="PlaceHolder3" runat="server"></asp:PlaceHolder>
                            </div>            
                            </asp:Panel>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <div class="category">
                        <h3>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("titolo") %>'/>
                            <asp:HiddenField ID="Label5" runat="server" Value='<%# Bind("categoriaid") %>'/>
                        </h3>
                         <asp:ImageButton ID="ImageButton5" runat="server" ImageUrl='<%# "../" + Eval("image") %>'
                                        AlternateText='<%# Eval("descrizione") %>' CommandName="Select" />
                        <p>
                            <%# Eval("descrizione")%>
                        </p>
                   </div>
                </ItemTemplate>
                <SelectedItemTemplate>
                    <div class="selected">
                        <h3>
                            <%# Eval("titolo")%>
                        </h3>
                        <asp:Image ID="SushiImage3" runat="server" AlternateText='<%# Eval("descrizione") %>'
                            Width="140px" ImageUrl='<%# "../" + Eval("image") %>' />
                        <p>
                            <%# Eval("descrizione")%>
                        </p>
                    </div>
                </SelectedItemTemplate>
            </telerik:RadListView>
             
                <asp:Panel ID="pnlDettaglioVendite"  runat="server" Visible="false">
                <telerik:RadListView ID="lstProductVendita" runat="server"
                    ItemPlaceholderID="ProductsVenditaContainer"
                    AllowPaging="true" DataKeyNames="IDProdotto" PageSize="4"
                    OnNeedDataSource="lstProductVendita_NeedDataSource">
                    <LayoutTemplate>
                            <table cellpadding="0" cellspacing="0" border="0" width="100%;" style="clear: both;">
                                <tr>
                                    <td>
                                        <asp:PlaceHolder ID="ProductsVenditaContainer" runat="server"></asp:PlaceHolder>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="bottom">
                                        <telerik:RadDataPager  ID="RadDataPagerVendite" Skin="Vista"  runat="server" PagedControlID="lstProductVendita"
                                            PageSize="4">
                                            <Fields>
                                                 <telerik:RadDataPagerSliderField  SliderIncreaseText="Più" SliderDecreaseText="Meno"
                                                  SliderDragText="Trascina" />    
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </td>
                                </tr>
                            </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <table  style="float:left; width: 478px; height: 150px; background-color:White; margin:2px 2px 2px 2px">
                            <tr>                                       
                                <td>                                       
                                    <div class="photo-container-noleggio">
                                        <asp:Image ID="imgProdottoVendita" runat="server" AlternateText='<%# Eval("NomeProdotto") %>'
                                            Width="100px" Height="100px" ImageUrl='<%# "../" + Eval("FotoPath") %>' />
                                    </div>
                                </td>
                                <td>
                                    <div class="detailsNoleggio">                                       
                                        <div class="data-container-noleggio">
                                            <ul>
                                                <li>
                                                   Marca: <label><%#Eval("Marca")%></label>
                                                </li>
                                                <li>
                                                    Modello: <label><%#Eval("NomeProdotto")%></label>
                                                </li>
                                                <li>
                                                    Canone mensile: <label> <%#((decimal) Eval("PrezzoVendita")).ToString("N2") %></label>
                                                </li>
                                                <li>
                                                   Modello: <label><%#Eval("Descrizione")%></label>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>     
                                <td valign="top">
                                    <div class="document">          
                                         <asp:HyperLink Text=""  ID="ImageDocV" runat="server" AlternateText="" Visible='<%# Eval("DocumentPath").ToString() != ""%>'
                                                    SkinID="ImgPdf32"  NavigateUrl='<%# Eval("DocumentPath").ToString() == "" ? "#" : "../" + Eval("DocumentPath") %>' />
                                    </div>
                                </td>                                                                      
                            </tr>                               
                        </table>
     
                    </ItemTemplate>
                </telerik:RadListView>
             
            </asp:Panel>
             
        </telerik:RadPageView>
     
    </telerik:RadMultiPage>
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 26 Nov 2010 Link to this post

    Hi Marco,

    I tried to reproduce the described issue but to no avail. I am sending you a simple example based on your code. Please check it out and let me know what differs in your case. Also it will be helpful if you could post the aspx page markup with the related code behind code. Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.

    Regards,
    Radoslav
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top