MVC form widget on master page - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

MVC form widget on master page

  • 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?


  • Hello,

    When creating the form's markup you have to use @Html.BeginFormSitefinity instead of @Html.BeginForm as stated in the following documentation article:

    The @Html.BeginFormSitefintiy helper handles form submissions correctly when the widget is placed on a hybrid page or page template.

    Velizar Bishurov
    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