MVC form widget on master page
We created an MVC form widget that is being used for a custom search form. When it is added to the search page the form displays and submits as expected.
However, we would also like this form to be displayed on all pages so we added it to the shell template for the site. When the form is placed here, it displays correctly but when hitting the submit button it only does a post back of that page.
Looking at the generated html, the form tag around the input and buttons is not being rendered so it seems like the submit button is instead triggering the submit for the page level form created from the webform.
I've tried giving the MVC form a unique id as well as changing the submit button to a standard button and using jquery to trigger the form submit but nothing seems to have worked.
Is there something else that needs to be done to have this widget be recognized as a separate form?
Thanks!
Hello,
When creating the form's markup you have to use @Html.BeginFormSitefinity instead of @Html.BeginForm as stated in the following documentation article: http://docs.sitefinity.com/for-developers-mvc-modes#mode-comparison-table
The @Html.BeginFormSitefintiy helper handles form submissions correctly when the widget is placed on a hybrid page or page template.
Regards,
Velizar Bishurov
Telerik