Copied to clipboard

Flag this post as spam?

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


  • Mike Olund 45 posts 66 karma points
    Jun 17, 2012 @ 00:39
    Mike Olund
    0

    SurfaceController with BeginUmbracoForm

    I'm 3 days into backporting our project from Umbraco 5.1 to Umbraco 4.7.2. So far I've been doing everything in a mix of Razor macros and webforms Masterpages.  The cultiv razor examples were a great starting point

    http://our.umbraco.org/projects/developer-tools/cultiv-razor-examples

    The next page I need to backport is a contact form.  It is written using a SurfaceController with BeginUmbracoForm.

    From what I can see, I have two options for doing this in Razor:

    1) MVCBridge: http://our.umbraco.org/projects/developer-tools/mvcbridge

    2) Based on the cultiv razor contact form: http://our.umbraco.org/projects/website-utilities/cultiv-razor-contact-form

    I prefer to stick with a strongly typed model, and write as little code as possible in my Razor views, so MVC Bridge seems most appealing.  But I'm a little bit hesitant to use MVC Bridge because it doesn't have a lot of downloads or a lot of reviews. 

    Can anyone reasure me that MVC Bridge will work with 4.7.2?  Is there a third option that I should look at (but not Contour, I'm a developer not a designer)

    Mike

  • John Proctor 12 posts 32 karma points
    Jun 19, 2012 @ 15:51
    John Proctor
    0

    Hi Mike,

    In a similar situation trying to rebuild a v5 project in v4.  We are getting started in using MVC Bridge, it does indeed work in 4.7.  One little gotcha is that you need to supply a formToken, not sure the documentation was very clear on that, otherwise you won't get a POST to work.  Can't really vouch for it in production or anything though!

    The problem that leaves us is that we had JsonResult actions which we can't seem to get at.  Our current thinking is that they will either need to be refactored as Web Methods or we will add a MVC project to provide services and ajaxy things and move this into umbraco as things progress with MVC.

    I'm also having problems getting a member by the id in a WCF service, where before I was able to use depedency resolver to get IUmbracoApplicationContext.  Assume I must be missing something somewhere.

    Good luck, interested to know how you get on!

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Jun 19, 2012 @ 23:07
    Dan Diplo
    0

    I've just written a blog post on how to create a contact form in Razor using 4.7 that has a strongly-typed model and has as much log as possible in a class file. It's not MVC, but I think the concepts are pretty similar. There is also an accompanying package that demonstrate this (with source code).

  • Mike Olund 45 posts 66 karma points
    Jun 23, 2012 @ 00:10
    Mike Olund
    0

    Thanks for your help Dan. My final implementation took a lot of inspiration from your blog post.

Please Sign in or register to post replies

Write your reply to:

Draft