Click here to Skip to main content
15,924,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
page struct :
-content
---script manager

----- update panel

--------repeater


<cc1:AsyncFileUpload ThrobberID="Img3" ID="yukleyici" runat="server" onupladcompleted="yukleyici_UploadedComplete"
Width="100%" EnableViewState="False" />

---------/repeater

-----/updatepanel

--/content




code behind ;
   protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        AsyncFileUpload fo = (AsyncFileUpload)e.Item.FindControl("yukleyici");

        PostBackTrigger trigger = new PostBackTrigger();

        trigger.ControlID = fo.ClientID;
      

        this.UpdatePanel1.Triggers.Add(trigger);

    }



 public void GetFiles()
{

 for (int i = 0; i < repeater.Items.Count; i++)
        {
            KullaniciResim yeni = new KullaniciResim ();

            AsyncFileUpload fu = (AsyncFileUpload)repeater.Items[i].FindControl("yukleyici");
         
            HiddenField hfevrakid = (HiddenField)repeater.Items[i].FindControl("hdEvrakTipId");
            HiddenField hfbasvuruid = (HiddenField)repeater.Items[i].FindControl("hdBasvuruTipId");
            yeni.BasvuruId = yenibasvuru.Id;
            yeni.EvrakId = Convert.ToInt32(hfevrakid.Value);
            yeni.IslemiYapan = Convert.ToInt32(this.Page.User.Identity.Name);
          
                if (fu.HasFile)
                {
                    yeni.ResimDurumu = true;
                    yeni.IslemTarihi = DateTime.Now;
                    yeni.ResimDosyasi = Guid.NewGuid().ToString().Trim('-') + fu.FileName;
                }
           
        }


}



with these codes I want to getfiles asyncfileuploaders in repeater.
but fileuploaders onuploadcompleted event never fires. . I had tried many ways . as adding triggers etc.
Thanks everyone who cares.

[Modified: fixed </pre> tag]
Posted
Updated 24-Mar-10 12:18pm
v2

1 solution

Ozgur salginci wrote:
<cc1:removed throbberid="Img3" id="yukleyici" runat="server" onupladcompleted="yukleyici_UploadedComplete" xmlns:cc1="#unknown">
Width="100%" EnableViewState="False" />


Looks like this is a Custom Control. What is the base control that you had used?

From your page design, you have placed the fileuploaded inside the UpdatePanel. ASP.NET file upload control is not compatible with Update panel and needs full postback to work properly. So, if that controls is used in order to built it, you might try out placing them outside update panel and check.

If you cant avoid placing the fileupload inside UpdatePanel, then use a PostbackTrigger of Updatepanel for fileuploads.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900