Problem finding control in a Dynamic Data website

  •  05-18-2009, 12:33 PM

    Problem finding control in a Dynamic Data website

    Hello,
     
    I am trying to implement the AjaxUploader control on a custom Insert page in a Dynamic Data (Asp.Net 3.5) website.  I was able to get it working on a custom Edit page.  I am using a FormView, and have been able to use the FindControl function to locate the the Uploader everywhere except in the OnInit method.  The impact is that the UploaderEventHandler is not being added to the uploader.
     
    Here is my code:
     
     protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            FormView1.DefaultMode = FormViewMode.Insert;
            UploadAttachments Uploader1 = (UploadAttachments)FormView1.FindControl("Uploader1");
            try
            {
                lbl_status.Text = "uploader found";
                Uploader1.FileUploaded += new UploaderEventHandler(Uploader_FileUploaded);
            }
            catch
            {
                lbl_status.Text = "not found";
            }
            //btn_cancel.Click += new EventHandler(ButtonPostBack_Click);
        }
View Complete Thread