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

AJAX panel and manger is not working

1 Answer 25 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
usman
Top achievements
Rank 1
usman asked on 03 Jun 2012, 09:10 AM

Idid a same thing with another page in the same namespace and its working 

but here its not working and I am forced to paste the code ,Please sugggest the solution 

<%@ Page Title="Subscribe for Category" Async="true" Language="C#" MasterPageFile="~/singleMaster.master" AutoEventWireup="true" CodeFile="SuscribeCat.aspx.cs" Inherits="SuscribeCat" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
     </telerik:RadScriptManager>
 
   <br />
    <h2>   My Expert Profile</h2>
         <br />
         <table style="width:800px">
   <tr>
   <td style="width:3%">
   </td>
   <td>The main Categories you Subscribed</td>
    
   </tr>
    
   </table>
    
   <br />
   <table style=" width:800px">
   <tr>
   <td style=" width:5%"></td><td>
   <telerik:RadGrid ID="sub_cat_gird" OnItemCommand="del_sub" ShowHeader="false" ShowFooter="false"  runat="server" Width="600px" Skin="Sitefinity"
    AutoGenerateColumns="false" >
   <MasterTableView>
   <NoRecordsTemplate>  </NoRecordsTemplate>
   <Columns >
    
    
   <telerik:GridTemplateColumn>
   <ItemStyle Width="70px" />
   <ItemTemplate>
   <asp:Label ID="lblbl" runat="server" Text= '<%#Eval("name")%>' ></asp:Label>
   </ItemTemplate>
   </telerik:GridTemplateColumn>
    
   <telerik:GridTemplateColumn><ItemStyle Width="50px" /> <ItemTemplate> >> </ItemTemplate> </telerik:GridTemplateColumn>
    
   <telerik:GridTemplateColumn>
   <ItemStyle Width="70px" />
   <ItemTemplate>
   <asp:Label ID="lml" runat="server" Text='<%#Eval("sub_name") %>' ></asp:Label>
   </ItemTemplate>
   </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn><ItemStyle Width="50px" /> <ItemTemplate></ItemTemplate> </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn><ItemStyle Width="70px" /> <ItemTemplate></ItemTemplate> </telerik:GridTemplateColumn>
    
   <telerik:GridTemplateColumn>
   <ItemStyle />
   <ItemTemplate>
   <asp:Button ID="btn1" runat="server" Text="Delete" CssClass="art-button" CommandName="del_sub" CommandArgument=<%#Eval("sub_cat_id") %> />
   </ItemTemplate>
   </telerik:GridTemplateColumn>
    
   </Columns>
    
   </MasterTableView>
   
    </telerik:RadGrid>
    </td>
     </tr>
    </table>
    <%--<table style="width:800px">
    <tr><td style=" width:5%"></td></tr>
    </table>--%>
    
     <table style=" width:800px">
   <tr>
   <td style=" width:5%"></td>
   <td>
   <telerik:RadGrid ID="sub_sub_cat_grid" ShowHeader="false" ShowFooter="false"  runat="server" Width="600px" Skin="Sitefinity"
    OnItemCommand="del_sub_sub" AutoGenerateColumns="false" >
    
   <MasterTableView>
   <NoRecordsTemplate>  </NoRecordsTemplate>
   <Columns >
    
  <telerik:GridTemplateColumn>
  <ItemStyle Width="70px" />
  <ItemTemplate>
  <asp:Label ID="lki" runat="server" Text = '<%#Eval("main_name")%>'  ></asp:Label>
  </ItemTemplate>
  </telerik:GridTemplateColumn>
  
 <telerik:GridTemplateColumn><ItemStyle Width="50px" /> <ItemTemplate> >> </ItemTemplate> </telerik:GridTemplateColumn>
    
   
   
   <telerik:GridTemplateColumn>
   <ItemStyle  Width="70px" />
   <ItemTemplate>
   <asp:Label ID="lml" runat="server" Text='<%#Eval("sub_name") %>' ></asp:Label>
   </ItemTemplate>
   </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn><ItemStyle Width="50px" /> <ItemTemplate> >> </ItemTemplate> </telerik:GridTemplateColumn>
     <telerik:GridTemplateColumn>
     <ItemStyle Width="70px" />
     <ItemTemplate>
       <asp:Label ID="lml1" runat="server" Text='<%#Eval("sub_sub_name") %>' ></asp:Label>
     </ItemTemplate>
     </telerik:GridTemplateColumn>
 
   <telerik:GridTemplateColumn>
   <ItemStyle  />
   <ItemTemplate>
   <asp:Button ID="btn1" runat="server" Text="Delete" CssClass="art-button" CommandName="del_sub_sub" CommandArgument=<%#Eval("sub_sub_cat_id") %> />
   </ItemTemplate>
   </telerik:GridTemplateColumn>
    
   </Columns>
    
   </MasterTableView>
   
    </telerik:RadGrid></td>
     </tr>
    </table>
    <br/>
    
    <br/>
    <br/>
    
 
   
     
    <br/>
    <telerik:RadAjaxPanel ID="panel" runat="server">
    <table style=" width:800px">
    <tr style=" height:40px">
    <td style=" width:5%"></td>
     <td style=" width:25%"> Select Main Category</td>
     <td>
      
     <asp:DropDownList ID="DropDownList1" AppendDataBoundItems="true" runat="server" DataSourceID="main_cat"
                        DataTextField="name" DataValueField="main_cat_id"
                        onselectedindexchanged="DropDownList1_SelectedIndexChanged"  Width="200px"
                        AutoPostBack="true">
                        <asp:ListItem Selected="True" Value="0">Select a Category</asp:ListItem>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="main_cat" runat="server"
                        ConnectionString="<%$ ConnectionStrings:QConnection %>"
                        SelectCommand="SELECT [main_cat_id], [name] FROM [main_cat_tbl]"></asp:SqlDataSource>
     </td>
    </tr>
 
    <tr style=" height:40px">
    <td style=" width:5%"></td>
     <td style=" width:25%"> Select Sub-Category</td>
     <td>
      <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="sub_cat"
                        DataTextField="name" DataValueField="sub_cat_id"
                        onselectedindexchanged="DropDownList2_SelectedIndexChanged"  Width="200px"
                        Enabled="false" AutoPostBack="true" AppendDataBoundItems="True">
                        <asp:ListItem Selected="True" Value="0">Select a subcategory</asp:ListItem>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sub_cat" runat="server"
                        ConnectionString="<%$ ConnectionStrings:QConnection %>"
                        SelectCommand="select sub_cat_id, name from sub_cat_tbl  where main_cat_id=@main_cat_id ">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="main_cat_id"
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                    </asp:SqlDataSource>
      
     </td>
    </tr>
 
    <tr style=" height:40px">
    <td style=" width:5%"></td>
     <td style=" width:25%"> Select Sub-Sub Category</td>
     <td>
     <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="sub_sub_cat"
                        DataTextField="name" DataValueField="sub_sub_cat_id" Enabled="false" Width="200px"
                        AutoPostBack="true" AppendDataBoundItems="True">
                        <asp:ListItem Selected="True" Value="0">Select a subcategory</asp:ListItem>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sub_sub_cat" runat="server"
                        ConnectionString="<%$ ConnectionStrings:QConnection %>"
                        SelectCommand="select sub_sub_cat_id, name from sub_sub_cat_tbl  where sub_cat_id=@sub_cat_id ">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList2" Name="sub_cat_id"
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                    </asp:SqlDataSource>
     </td>
    </tr>
 
    <tr style=" height:60px">
    <td style=" width:5%"></td>
     <td style=" width:25%"></td>
     <td>
     <asp:Button ID="Button1" runat="server" Text="Sign up as expert"
                        onclick="Button1_Click" />
     </td>
    </tr>
    <tr>
    <td></td><td></td><td></td><td> <asp:Label ID="SuscribtionStatus" runat="server" Visible="false" ></asp:Label></td>
    </tr>
    </table>
    </telerik:RadAjaxPanel>
     
    <telerik:RadAjaxManager ID="ajax_manger" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="DropDownList1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DropDownList1" />
                    <telerik:AjaxUpdatedControl ControlID="DropDownList2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="DropDownList2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DropDownList2" />
                    <telerik:AjaxUpdatedControl ControlID="DropDownList3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="DropDownList3">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DropDownList3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="sub_cat_gird" />
                    <telerik:AjaxUpdatedControl ControlID="sub_sub_cat_grid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Jun 2012, 02:48 PM
Hi Usman,

Using RadAjaxPanel simultaneously with RadAjaxManager or UpdatePanel ( or implementing multiple wrapped RadAjaxPanels ) is not a supported scenario and we highly recommend to avoid such implementation. Please either use just the manager to update your controls replacing the AjaxPanel with a regular asp:Panel, or use the RadAjaxPanel alone to wrap your page.

Furthermore, in a complex scenario like WebUserControls or Master/ContentPages, we recommend you to place RadAjaxManager instance on the main/master page and add a proxy control to the user control/content page as described in the following help topic:
RadAjax and MasterPage

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
usman
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or