Welcome Guest Search | Active Topics | Sign In | Register

CallbackPanel and HtmlInputFile Options
Samuele
Posted: Wednesday, July 11, 2007 1:43:23 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

I've create a CallbackPanel and inside i've insert a DataGrid. The CallbackPanel have trigger on DataGrid events.
The Datagrid have a model column with (in edit mode) an HtmlInputFile for uploading image.
When i execute a postback PostedFile is ever a nothing.

I've try to set HtmlInputFile like runat server but nothing.
I've try to set HtmlInputFile like html and find in Form.Files but nothing.
I've try to cancell CallbackPanel and its work correctly.

Thanks
Paroca
Samuele
Posted: Tuesday, July 17, 2007 2:17:37 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

there is no solution for my problem??
Else i must change my methods for finish my current job.

Thanks
Paroca
eo_support
Posted: Tuesday, July 17, 2007 6:40:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Paroca,

Sorry about the delay. We are looking into it and will get back to you as soon as possible.

Thanks
Samuele
Posted: Tuesday, July 17, 2007 7:01:37 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

I did not want to put haste to you, but I had to know that way to take..

Very very Tanks
Paroca
eo_support
Posted: Tuesday, July 17, 2007 8:02:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Samuele,

We looked into the issue. The root of the the problem is a CallbackPanel does NOT postbacks the files for you. It posts back all other form data but not the file. File is a very special input element and it's much more complicated to AJAX-enable it (We have a totally separate control that does just that).

If you are fine with full page reload with file submit (You can still use CallbackPanel for other partial page update, for example, displaying the file input element) You can use the following workaround:
1. Make sure you have enctype="multipart/form-data" on your form element;
2. Avoid letting the DataGrid to submit the change. You can use a regular HTML element to submit the change, for example, a TemplateColumn like this:

Code: HTML/ASPX
<asp:TemplateColumn>
    <ItemTemplate>
        <input type="submit" value="Submit" />
    </ItemTemplate>
</asp:TemplateColumn>


This should give you the file. However this does not give you the item index like a regular DataGrid event does. So you will need to have some mechanism to "remember" the last edited item index.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.