MVC form widget on master page

Posted by Community Admin on 04-Aug-2018 11:52

MVC form widget on master page

All Replies

Posted by Community Admin on 16-May-2016 00:00

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!

Posted by Community Admin on 19-May-2016 00:00

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

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed