Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob Watkins 370 posts 702 karma points
    Jun 13, 2016 @ 14:53
    Rob Watkins
    0

    Mixing WebForms and MVC on Umbraco 7.4.1

    I am completely upgrading an old site to Umbraco 7.4.1.

    The new site uses MVC exclusively. However, there are a lot of old usercontrols / masterpages containing custom (but non-Umbraco) functionality that cannot be quickly and easily upgraded.

    I would like to just have those as masterpages on the new install; this SO answer seems to imply it is possible:

    http://stackoverflow.com/a/24186675/318411

    Short answer is yes, you can mix MVC and Webforms within an Umbraco 7 project. The rendering engine is determined by the template.

    If an MVC template is found then it will use MVC as the rendering engine, otherwise it will look for a .master template (in the masterpages folder) and if it finds one it will use Webforms

    However I've tried everything I think that post might mean and it doesn't work. Is this possible? If so, how do I make it work?

  • Rob Watkins 370 posts 702 karma points
    Jun 13, 2016 @ 15:40
    Rob Watkins
    0

    Well, I've got this working, but it's a bit clunky!

    I need to create the Template as normal, which creates an MVC view.

    Then I can paste the Webforms code over the top and save; this still saves to /Views.

    Then I need to manually move it to /masterpages and change the extension to .master, at which point the site works.

    After this, any edits in the Umbraco backend will correctly save to the /masterpages/mytemplate.master file.

    Is there something I'm missing? Shouldn't it be doing the move-on-first-save for me?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies