This is a migrated thread and some comments may be shown as answers.
Apply ajax on dynamically added usercontrol
1 Answer 65 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
mfmz asked on 21 Mar 2008, 06:24 AM

In my project i am adding usercontrol dynamically that is productlist.ascx in content page which is LoadPage.aspx (using master page). there are two dropdown on productlist.ascx: one is drpcountry and other is drpcity. i am filling drpcity when i click on drpcountry using ajax. But ajax is not applying in this scenerio on dropdown click.

But in other case where usercontrol is static in aspx page is working fine. In above case when it is dynamic it is not working.

Code on ProductList.ascx:

<asp:DropDownList ID="drpCountry" runat="server" Width="148px" AutoPostBack="True" OnSelectedIndexChanged="drpCountry_SelectedIndexChanged" meta:resourcekey="drpCountryResource1" >
<asp:DropDownList ID="drpCity" runat="server" Width="148px" meta:resourcekey="drpCityResource1">
            <asp:ListItem Value="0" meta:resourcekey="ListItemResource1">-- Not Available --</asp:ListItem>

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <telerik:AjaxSetting AjaxControlID="drpCountry">
                <telerik:AjaxUpdatedControl ControlID="drpCity" />


code on LoadPage.aspx:

<asp:Content ID="content1" ContentPlaceHolderID="CentralColumn" runat="server">
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
 <asp:Panel ID="Panel1" runat="server" Height="50px" Width="100%">
 <asp:PlaceHolder ID="phControlHolder" Runat="server" Visible="True"></asp:PlaceHolder>
    &nbsp;<br />
    <radA:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="100%">

        <radA:RadAjaxManager ID="RadAjaxManager2" runat="server">
        <radA:AjaxLoadingPanel ID="AjaxLoadingPanel2" runat="server" Height="75px" Width="75px">
            <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/App_Themes/Ajax/Default/loading.gif" />


I am dynamically adding usercontrol in panel on loadpage.aspx page.

I am currently using new radcontrols "RadControls_Prometheus_2007_3_1425".


1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 21 Mar 2008, 07:00 AM
Ah, I just answered the same question:

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question