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.
mfmz
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>
<asp:DropDownList ID="drpCity" runat="server" Width="148px" meta:resourcekey="drpCityResource1">
            <asp:ListItem Value="0" meta:resourcekey="ListItemResource1">-- Not Available --</asp:ListItem>
        </asp:DropDownList>

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

 

code on LoadPage.aspx:

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

  
        <radA:RadAjaxManager ID="RadAjaxManager2" runat="server">
        </radA:RadAjaxManager>
        <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" />
        </radA:AjaxLoadingPanel>
  

</asp:Content>

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

I am currently using new radcontrols "RadControls_Prometheus_2007_3_1425".

Farrukh

1 Answer, 1 is accepted

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

http://www.telerik.com/community/forums/thread/b311D-bctmhm.aspx

-Leon
Tags
Ajax
Asked by
mfmz
Top achievements
Rank 1
Answers by
Leon
Top achievements
Rank 1
Share this question
or