Hello guys I am geting error if user do some wierd things in his frontend dashboard.
I have 2 fields for image upload.
Lets say that first image is allredy uploaded and he try to upload second image, but upload fails and display some warrning that image is too big, after that user decide to delete first image. When he click delete the first image he gets this error:
After that if user goes back and refresh the page, everthing will be ok.
It looks like you're using a normal MVC controller and your returned action results are for MVC as well.
When you submit forms and return from the controller you have 'to stay' in the Umbraco workflow.
In your view you have to use 'BeginUmbracoForm' instead 'BeginForm'.
Your controller has to inherit from 'SurfaceController' and the way you return to umbraco pages is using some special Umbraco action results like 'return RedirectToUmbracoPage(id)' instead Redirect.
If you want to keep your ModelState, i.e. errors in the form you need to use 'return CurrentUmbracoPage()'
There is no current PublishedRequest
Hello guys I am geting error if user do some wierd things in his frontend dashboard.
I have 2 fields for image upload.
Lets say that first image is allredy uploaded and he try to upload second image, but upload fails and display some warrning that image is too big, after that user decide to delete first image. When he click delete the first image he gets this error:
After that if user goes back and refresh the page, everthing will be ok.
Anybody have an idea what is wrong?
Can we see the code you are using to delete that image? Frontend and backend.
Hi Mario,
Yes ofcourse, here is the frontend code:
This is backend code for deleting images:
It looks like you're using a normal MVC controller and your returned action results are for MVC as well.
When you submit forms and return from the controller you have 'to stay' in the Umbraco workflow.
In your view you have to use 'BeginUmbracoForm' instead 'BeginForm'.
Your controller has to inherit from 'SurfaceController' and the way you return to umbraco pages is using some special Umbraco action results like 'return RedirectToUmbracoPage(id)' instead Redirect.
If you want to keep your ModelState, i.e. errors in the form you need to use 'return CurrentUmbracoPage()'
Hi Mario,
I changed it and its working now. I didnt know how flow is working, now I understund it better.
Thanks
BR
Silvija
is working on a reply...