Copied to clipboard

Flag this post as spam?

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


  • Luke Alderton 192 posts 509 karma points
    Mar 19, 2013 @ 11:41
    Luke Alderton
    0

    Using a usercontrol form in an MVC website doesn't post

    I've recently upgraded to Umbraco 4.11.5 and I've written a site using MVC however I'd also like to render a macro in an MVC page, for example I have a macro linked to a contact form user control and I've managed to render it in the MVC page but it's not posting, the user control was taken from a working website.

    I was wondering if I could get the usercontrol to post successfully or would I have to create the form again in an MVC partial view? I ask because I'd like to keep the functionality that already exists in usercontrols for example I can drag a grid view into a usercontrol using visual studio but I can't for MVC, maybe there is a way around this functionality that I don't know about?

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Mar 19, 2013 @ 12:08
    Peter Gregory
    0

    Hi Luke

    Unfortunately you will not be able to use the usercontrol with postback in an MVC site.  You will need to rewrite your control as a SurfaceController.

    The following documentation is a walk through on how to create a contact for using a SurfaceController http://our.umbraco.org/Documentation/Reference/Mvc/Forms/turorial-partial-views

  • Luke Alderton 192 posts 509 karma points
    Mar 19, 2013 @ 12:22
    Luke Alderton
    0

    Okay, thanks, I figured as much, in terms of the drag and drop functionality for user controls in visual studio, are there any libraries or extensions available that would provide me with the same end result?

Please Sign in or register to post replies

Write your reply to:

Draft