Hi there, i am getting some errors with my asyncFileUpload.
I have a page with <formview><updatePanel><AsyncFileUpload>
when it is in ADD mode, the page works fine.
Now I put it in EDIT MODE. I open the page and it works fine but as soon as i try to upload an image the nightmare starts.
Debuggin I can arrive to these conclusions:
when I open the page for the first time, the sequence is: method load, AdFormView_ItemCreated (empty method), the Bind Process, AdFormView_DataBound.... Everything is ok.
I click the button to upload and: AdFormView_ItemCreated, CONTROLSKIN(), Load, DataBound... but at this point controls are not recognized.
I spent several hours to really undestand what was happening. Fortunatelly I was able to get rid of it.
My FormView was being changed to Edit Mode whenever a user clicks on the Edit Button of a GridView. This click was also responsible to change one parameter value of my ObjectDataSource that was binding the right record in the FormView.
Everything was working as it should be in the page with all the controls so far.
When I had to add an AsyncFileUpload, it stopped to work only when the FormView was going to Edit Mode.
The AsyncFileUpload control generated a hidden iframe referencing the same webpage where the control is placed to store the uploaded files.
When I investigated the FormView in the iframe was returning no records (I believe by desing they do not want to bind two pages in parallel) and, once I did not have a EmptyDataTemplate, the FormView was totally empty. Therefore the AsyncFileUpload control
was not able to find its copy in the iframe and the error was being raised.
The solution: Create an EmptyDataTemplate with an AsyncFileUpload on it with the same id that you set in Edit Mode.
giri283
Member
4 Points
9 Posts
AsyncFileUpload with FormView in Edit Mode
Feb 16, 2010 04:19 PM|LINK
Hi there, i am getting some errors with my asyncFileUpload.
I have a page with <formview><updatePanel><AsyncFileUpload>
when it is in ADD mode, the page works fine.
Now I put it in EDIT MODE. I open the page and it works fine but as soon as i try to upload an image the nightmare starts.
Debuggin I can arrive to these conclusions:
The FormView has not been created.
Any suggestion?
Thank you in advance
FormView AsyncFileUpload edit mode
giri283
Member
4 Points
9 Posts
Re: AsyncFileUpload with FormView in Edit Mode
Feb 22, 2010 03:07 PM|LINK
Hi everybody, I found the solution and probably this may help someone else.
My page with a formview uses stored procedures (SP) both for the select and edit mode.
there are 2 parameters to pass to the select SP which are a control and a querystring parameter.
Well, if you have an asyncFileUpload in the edit page, this page doesn't work.
The reason is that when you try to upload an image, the QUERYSTRING parameter is not available and the SP returns NULL.
If you set a DefaultValue it works fine. Try to work around this problem in your project.
FormView AsyncFileUpload edit mode querystring
Pedro Consta...
Member
2 Points
1 Post
Re: AsyncFileUpload with FormView in Edit Mode
Feb 08, 2013 12:46 AM|LINK
I spent several hours to really undestand what was happening. Fortunatelly I was able to get rid of it.
My FormView was being changed to Edit Mode whenever a user clicks on the Edit Button of a GridView. This click was also responsible to change one parameter value of my ObjectDataSource that was binding the right record in the FormView.
Everything was working as it should be in the page with all the controls so far.
When I had to add an AsyncFileUpload, it stopped to work only when the FormView was going to Edit Mode.
The AsyncFileUpload control generated a hidden iframe referencing the same webpage where the control is placed to store the uploaded files.
When I investigated the FormView in the iframe was returning no records (I believe by desing they do not want to bind two pages in parallel) and, once I did not have a EmptyDataTemplate, the FormView was totally empty. Therefore the AsyncFileUpload control was not able to find its copy in the iframe and the error was being raised.
The solution: Create an EmptyDataTemplate with an AsyncFileUpload on it with the same id that you set in Edit Mode.
I hope it helps!
AsyncFileUpload querystring