More in this section
Forums / Developing with Sitefinity / MVC form widget on master page

MVC form widget on master page

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Susan
    Susan avatar
    1 posts
    13 Apr 2015
    16 May 2016
    Link to this post

    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?


  2. Velizar Bishurov
    Velizar Bishurov avatar
    143 posts
    18 Sep 2017
    19 May 2016
    Link to this post

    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
2 posts, 0 answered