[RESOLVED]AjaxFileUpload Inside A Repeater

My .aspx page is like this :

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource4" OnItemCommand="Repeater1_ItemCommand">
            <table ID="Table1">
                    <asp:BulletedList ID="BulletedList1" runat="server" DataSourceID="SqlDataSource6" DataTextField="WPName" DataValueField="WPName"></asp:BulletedList>
                    <asp:Button ID="Button2" runat="server" Text="Add KKP" CommandName="AddKKP"/>
                    <asp:Panel ID="Panel1" runat="server" Visible="false">
                        <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server"></ajaxToolkit:AjaxFileUpload>

how i declare codeBehind for AjaxFileUpload inside a repeater ? should i use FindControl ? how to throw CommandName from AjaxfileUpload upload button ?

my codeBehind :

protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
            if (e.CommandName == "AddKKP")
                Panel myPanel = (Panel)e.Item.FindControl("Panel1");
                myPanel.Visible = true;

Any sugestions ?

Thanks for your help.

Best Regards.


Please refer to the example at:



you can refer to blew code to get AjaxFileUpload.you can try it and test it.

private void getControl()
        foreach (RepeaterItem item in Repeater1.Items)
            Panel pnl = item.FindControl("Panel1") as Panel;
            AjaxControlToolkit.AjaxFileUpload af = (AjaxControlToolkit.AjaxFileUpload)pnl.FindControl("AjaxFileUpload1");

Hope this helps!


Leave a Reply