Copied to clipboard

Flag this post as spam?

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


  • pat 124 posts 346 karma points
    Nov 17, 2016 @ 16:10
    pat
    0

    MVC forms integrate to Umbraco 7.5.3

    Hi all, I am trying to create few forms like contact us, login, forgot password , my profile etc in to umbraco 7 site. I have umbraco 4 site with webform integrations to handle all these features plus shopping carts and many more features. I am looking for create brand new site using Umbraco 7 MVC rendering mode. so I need to migrate my forms to MVC. So thought do bit of testing install umbraco starter site.

    I addition to that I have started Empty MVC project in VS and created a contactform, model class and Controller of type SurfaceController then copy the cshtml file in to Views/MacroPartials folder and copied dll file in to bin folder.

    problem 1 - I have added macro via RTE (rich text Editor) and published it shows only Macro alias: ContactForm in web page

    logs says The model item passed into the dictionary is of type 'Umbraco.Web.Models.PartialViewMacroModel', but this dictionary requires a model item of type ..... error

    problem 2 - I have added a Macro Content as a property in to a document type and added macro using that.

    then added below line to page template get value cannot be null parameter name child as a error

    @if(CurrentPage.HasValue("macroContent")){
    
    @Umbraco.RenderMacro("CurrentPage.macroContent")
    }   
    

    what I am doing wrong here ??? ... any one there to help me please.

    with out fixing problem 1 / 2 i wouldn't imagine to move forward .... your genius ideas most welcome

  • Steve Morgan 1349 posts 4459 karma points c-trib
    Nov 21, 2016 @ 09:09
    Steve Morgan
    0

    Hi Pat,

    It might be worth you stepping through my blog post tutorials - I show how to set up user login and account maintenance in three posts.

    At the end of it you'll have some MVC code that does a great deal of what you need and a model you can follow to do your contact form etc.

    1. http://siempresolutions.co.uk/blog/UmbracoMembersProtectedAreaof_Website
      http://sie
    2. http://siempresolutions.co.uk/blog/UmbracoMembersProtectedAreaofWebsitePart2UsingMVCMembersController
    3. http://siempresolutions.co.uk/blog/UmbracoMembersPart3AFullSolution

    Hope that helps!

    Steve

  • pat 124 posts 346 karma points
    Nov 22, 2016 @ 17:01
    pat
    0

    Hi I need to avoid creating document types for each form page as i am going to have around 100 forms for customer portal .

    I have created a third macro which goes on Macro Partials folder which then can be can be call from RTE still no luck.

    but If I call Macro n document type it load my form but on submit button click i get error
    Could not find a Surface controller route in the RouteTable for controller name ContactUsController

    This is very frustrating and I have seen some where that there is a bug in umbraco that s why not rendering macros via RTE

    not sure what to do yet .... any help

Please Sign in or register to post replies

Write your reply to:

Draft