Copied to clipboard

Flag this post as spam?

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


  • Richard Terris 273 posts 715 karma points
    Mar 04, 2012 @ 23:50
    Richard Terris
    0

    Working with Models and Surface Controller

    Hi guys

    Following from the excellent walkthroughs http://shazwazza.com/category/Umbraco.aspx

    I'm struggling with Surface Controller and Models in Umbraco V5...

    An MVC app that works locally has a model called "contactResponse" and the view has the contact form.

    The controller for this has 2 methods for httpPost and httpGet which render different views when the contact form is submitted. So in MVC app I have no problem with this, it all works great.

    I've followed the instructions on the above tutorial for setting up a surface controller but when I create a ChildActionOnly macro in Umbraco, the surface controller does not appear in the drop down list, only the testSurface which I believe to be the Umbraco pre-defined controller.

    I know this is all pretty new, and I'm enjoying learning V5 but does anyone have any ideas on how to correctly use surface controllers?

    Thanks,

    Richard

  • Andrew Cullen 137 posts 237 karma points
    Mar 05, 2012 @ 16:59
    Andrew Cullen
    0

    Hey, Richard- I think this blog entry may have your answer: 

    http://cultiv.nl/blog/2011/11/15/creating-an-umbraco-5-package/

    The relevant bit:

    "Now, in order for Umbraco to even consider your DLL's as being a plugin, you absolutely HAVE to open up your Properties\AssemblyInfo.cs file in notepad and add a using statement (using Umbraco.Cms.Web;) and at the very bottom add an attribute: [assembly: AssemblyContainsPlugins]"

  • Richard Terris 273 posts 715 karma points
    Mar 05, 2012 @ 19:46
    Richard Terris
    0

    Hi Andrew

    Thanks for the tip.

    This is where my knowledge becomes limited - I can't find the assemblyinfo.cs file, do you know where it's located?

    Richard

  • Andrew Cullen 137 posts 237 karma points
    Mar 05, 2012 @ 19:48
    Andrew Cullen
    0

    Properties folder.

  • Richard Terris 273 posts 715 karma points
    Mar 05, 2012 @ 19:49
    Richard Terris
    0

    Yeah, sorry I should have been more specific - where is the properties folder?

  • Richard Terris 273 posts 715 karma points
    Mar 05, 2012 @ 20:13
    Richard Terris
    0

    Looked into this a bit more and it seems you only need to do it this way if you're creating the controller as a plugin, which I'm not.

    I think I need to develop a local copy of this site so I can get full debugging!

  • Andrew Cullen 137 posts 237 karma points
    Mar 05, 2012 @ 20:15
    Andrew Cullen
    0

    Fingers crossed for you - let me know if you succeed so I can try to duplicate!

  • Richard Terris 273 posts 715 karma points
    Mar 05, 2012 @ 20:48
    Richard Terris
    0

    No problem my friend, if I get it working when I get it working I'll give you a shout!

  • Andrew Cullen 137 posts 237 karma points
    Mar 05, 2012 @ 23:26
    Andrew Cullen
    0

    I like your optimism!

Please Sign in or register to post replies

Write your reply to:

Draft