Update panel with upload file

Khoa Nguyen asked on September 4, 2018 10:07

I have kentico on-line form working fine with update panel.

When i add upload file (field) to form, update panel not working (form reload after submit).

And then hide that field, update panel working again.

Any solutions or alternative ?

Here is my field setting: http://prntscr.com/kqd3gp

Recent Answers


Arun Kumar answered on September 4, 2018 10:37

FileUpload control will not work inside an UpdatePanel control because of file uploading and file manipulations are restricted by default in the client side for security reasons. Check this link for alternative solution. You can create your own custom form control for file upload and then use that instead.

0 votesVote for this answer Mark as a Correct answer

Khoa Nguyen answered on September 5, 2018 12:20

Hi Arun Kumar,

I have created custom control for file upload, code behind clone from ~\CMSFormControls\Media\UploadControl.ascx

I found it contain a code to register postback trigger in uploader

protected override void OnPreRender(EventArgs e)
{
//some stuff code...
// Register post back button for update panel
    if (Form.ShowImageButton && Form.SubmitImageButton.Visible)
    {
        ControlsHelper.RegisterPostbackControl(Form.SubmitImageButton);
    }
    else if (Form.SubmitButton.Visible)
    {
        ControlsHelper.RegisterPostbackControl(Form.SubmitButton);
    }
}

But if i remove that code, it won't upload anything.

I wonder if is there a way to make it work withou postback ?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.