Hi,
Just a curious question, why do you submit the search form in Edit Mode? To get a good editor experience?
Generally I don't recommend to submit forms in edit mode. It's better to tweak your view to give a good editor experience in Edit Mode instead.
If you need some search results listed to get a good editor experience I would suggest that you populate your search results with some dummy data when inside the Edit Mode.
You can check this in your Controller or view by looking at EPiServer.Editor.PageEditing.PageIsInEditMode (http://world.episerver.com/documentation/class-library/?documentId=cms/9/91E69382)
Hi, Kenia,
You can also use POST instead of GET in edit mode. When rendering the form:
@using (Html.BeginForm(null, null, Model.SearchPageRouteValues, PageEditing.PageIsInEditMode ? FormMethod.Post : FormMethod.Get, new RouteValueDictionary(new { @id = "search-form" }))) { ... }
But, generally, yes, we also don't support submitting forms in edit mode, it sometimes takes time to support it, so it does not pay off to invest time into it.
BR,
Marija
Hi there!
It's actually the client who reported this as a problem since she was clearly using the form both in edit and preview mode for searching. I know though edit mode is a little special to work with so I was hoping somebody would have some workaround for it.
Marija, the request has been sent as a "Post" from the beginning in the case of this page.
We drop the issue for now. Thanks anyway!
/Kenia
I'll make sure it's clear from the beginning in future projects, that form submitting is not supported in edit mode.
Thanks guys for your input!
/Kenia
Hello!
I have a page in Episerver CMS 8 that contains a simple search form (MVC). When in edit mode the page reloads after submitting the form which causes the search results to disappear. I have debugged it and first an action is called to perform the search which returns ans shows the results. Then inmediately the Index action is called and the page reloads.
Has anybody had a similar problem? Really tricky since the page works fine in view mode.
Thanks
/Kenia