This is a migrated thread and some comments may be shown as answers.

ajax postback removal

1 Answer 37 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marc Plaxton-Harrison
Top achievements
Rank 1
Marc Plaxton-Harrison asked on 20 Apr 2009, 01:19 PM
Hi all, i am encountering a problem that many others have had,

i am using a page that contains a user control, on the user control there are a few comboboxes, i am trying to change data in the combobox without having to do a postback, i have looked at the demos and other posts people have made and tried to use the methods provided but with no luck, the closest i have come is to have it working but with the following error on screen:

32709|updatePanel|Filter_Filter_cboSitePanel|

and the following code error:

Message: Sys.InvalidOperationException: A control is already associated with the element.

my code is as follows:

<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">   
           <AjaxSettings>  
               <telerik:AjaxSetting AjaxControlID="btnGetSites">   
                   <UpdatedControls>  
                       <telerik:AjaxUpdatedControl ControlID="cboSite" />  
                   </UpdatedControls>  
               </telerik:AjaxSetting>  
               <telerik:AjaxSetting AjaxControlID="btnGetLocations"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="cboLocation" /> 
                    </UpdatedControls> 
               </telerik:AjaxSetting> 
           </AjaxSettings>  
       </telerik:RadAjaxManager>  
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="30"  
            BackColor="#E0E0E0" InitialDelayTime="500" >  
            <asp:Image ID="Image1" runat="server" />   
        </telerik:RadAjaxLoadingPanel>  
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingCombos" runat="server" Transparency="30"  
            BackColor="#E0E0E0" InitialDelayTime="500">   
            <asp:Image ID="Image2" runat="server"/>   
        </telerik:RadAjaxLoadingPanel>  
 
<div>  
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
<ContentTemplate> 
          <table border="0" cellpadding="0" cellspacing="0" style="width: 190px; overflow: scroll;" enableviewstate="true" id="TABLE1"
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px; 
                                            border-bottom: #000000 1px solid"> 
                                            <asp:Label ID="lblHeader" runat="server" Style="font-weight: bold; font-size: 10pt; 
                                                color: #a276b6; font-family: tahoma" Text="Filter Details"></asp:Label></td
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <asp:Label ID="lblAccount" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                                Text="Account:" Font-Bold="True"></asp:Label> 
                                            </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <telerik:RadComboBox ID="cboAccount" runat="server" Skin="Default" ZIndex="25000" EnableItemCaching="True" Width="190px" style="overflow: hidden" Height="250px" DropDownWidth="350px" AutoPostBack="True"
                                                <ItemTemplate> 
                                                 <div> 
                                                        <telerik:RadTreeView ID="trvAccount" runat="server" CheckBoxes="True" OnClientNodeChecked="onClientNodeChecked" Height="200px"
                                                            <Nodes> 
                                                                <telerik:RadTreeNode runat="server" Text="Select All"
                                                                </telerik:RadTreeNode> 
                                                            </Nodes> 
                                                        </telerik:RadTreeView> 
                                                        </div> 
                                                        <table border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                                            <tr> 
                                                                <td style="text-align: center"
                                                                    <asp:Button ID="btnGetSites" runat="server" Text="Submit" OnClick="btnGetSites_Click" UseSubmitBehavior="False" /></td
                                                            </tr> 
                                                        </table> 
                                                </ItemTemplate> 
                                            </telerik:RadComboBox> 
                                                                    </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <asp:Label ID="lblSite" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                                Text="Site:" Font-Bold="True"></asp:Label></td
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <telerik:RadComboBox ID="cboSite" runat="server" Skin="Default" AutoPostBack="True" OnClientNodeChecked="onClientNodeChecked" OnSelectedIndexChanged="cboSite_SelectedIndexChanged" Width="190px" Height="250px" DropDownWidth="350px"
                                                <ItemTemplate> 
                                                        <telerik:RadTreeView ID="trvSite" runat="server" OnClientNodeChecked="onClientNodeChecked" OnClientNodeClicking="nodeSiteClicking" CheckBoxes="True" Height="200px"
                                                        </telerik:RadTreeView><table border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                                            <tr> 
                                                                <td style="text-align: center"
                                                                    <asp:Button ID="btnGetLocations" runat="server" Text="Submit" OnClick="btnGetLocations_Click" /></td
                                                            </tr> 
                                                        </table> 
                                                </ItemTemplate> 
                                            </telerik:RadComboBox> 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <asp:Label ID="lblLocation" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                                Text="Location:" Font-Bold="True"></asp:Label></td
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <telerik:RadComboBox ID="cboLocation" runat="server" Skin="Default" Width="190px" Height="250px" DropDownWidth="350px"
                                                <ItemTemplate> 
                                                    <div id="div3"
                                                        <telerik:RadTreeView ID="trvLocation" runat="server" OnClientNodeChecked="onClientNodeChecked" OnClientNodeClicking="nodeLocationClicking" CheckBoxes="True" Height="200px"
                                                        </telerik:RadTreeView><table border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                                            <tr> 
                                                                <td style="text-align: center"
                                                                    <asp:Button ID="btnSubmitLocation" runat="server" Text="Submit" OnClick="btnSubmitLocation_Click" /></td
                                                            </tr> 
                                                        </table> 
                                                    </div> 
                                                </ItemTemplate> 
                                            </telerik:RadComboBox> 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <asp:Label ID="lblAudit" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                                Text="Audit:" Font-Bold="True"></asp:Label></td
                                    </tr> 
                                    <tr> 
                                        <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                            <telerik:RadComboBox ID="cboAudit" runat="server" Skin="Default" Width="190px" DropDownWidth="350px" Height="250px"
                                                <ItemTemplate> 
                                                <div id="div4"
                                                    <telerik:RadTreeView ID="trvAudits" runat="server" OnClientNodeChecked="onClientNodeChecked" OnClientNodeClicking="nodeAuditClicking" CheckBoxes="True" Height="200px"
                                                    </telerik:RadTreeView><table border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                                                        <tr> 
                                                            <td style="text-align: center"
                                                                <asp:Button ID="btnSubmitAudits" runat="server" Text="Submit" OnClick="btnSubmitAudits_Click" /></td
                                                        </tr> 
                                                    </table> 
                                                    </div> 
                                                </ItemTemplate> 
                                            </telerik:RadComboBox> 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <td> 
                                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%"
                        <tr> 
                            <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                <asp:Label ID="lblDates" runat="server" Style="font-weight: bold; font-size: 8pt; 
                                    font-family: tahoma; color: #a276b6;" Text="Dates:"></asp:Label></td
                        </tr> 
                        <tr> 
                            <td colspan="1" style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; 
                                padding-top: 5px"> 
                                <asp:RadioButtonList ID="rbtnRange" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" style="font-size: 8pt" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
                                    <asp:ListItem Selected="True">All</asp:ListItem> 
                                    <asp:ListItem>Dates</asp:ListItem> 
                                </asp:RadioButtonList></td
                        </tr> 
                        <tr> 
                            <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                <asp:Label ID="lblDateFrom" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                    Text="Date From:" Font-Bold="True"></asp:Label></td
                        </tr> 
                        <tr> 
                            <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                <telerik:RadDatePicker ID="calFrom" runat="server" Enabled="False" Skin="Default" Width="190px"
                                    <DatePopupButton HoverImageUrl="" ImageUrl="" CssClass="rcCalPopup rcDisabled" /> 
                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                        ViewSelectorText="x"
                                    </Calendar> 
                                    <DateInput DateFormat="dd/MM/yyyy"
                                    </DateInput> 
                                </telerik:RadDatePicker> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                                <asp:Label ID="Label2" runat="server" Style="font-size: 8pt; font-family: tahoma; color: #a276b6;" 
                                    Text="Date To:" Font-Bold="True"></asp:Label></td
            </tr> 
            <tr> 
                <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px"
                    <telerik:RadDatePicker ID="calTo" runat="server" Enabled="False" Skin="Default" Width="190px"
                        <DatePopupButton HoverImageUrl="" ImageUrl="" CssClass="rcCalPopup rcDisabled" /> 
                        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                            ViewSelectorText="x"
                        </Calendar> 
                        <DateInput DateFormat="dd/MM/yyyy"
                        </DateInput> 
                    </telerik:RadDatePicker> 
                </td> 
            </tr> 
            <tr> 
                <td style="padding-right: 20px; padding-left: 10px; padding-bottom: 5px; padding-top: 5px; 
                    text-align: center"> 
                                            </td> 
            </tr> 
        </table>  
</ContentTemplate> 
</asp:UpdatePanel> 
</div>  

i am using RadControls for ASPNET AJAX Q1 2009, what am i missing??

thanks in advance

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 23 Apr 2009, 01:20 PM
Hello Marc,

Please try using RadAjax or MS UpdatePanel to ajaxify particular page content, but both.

Additionally, check out this help article for more information on how to use RadAjaxManager to ajaxify already ajaxified content.

All the best,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Marc Plaxton-Harrison
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or