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?
"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]"
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
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]"
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
Properties folder.
Yeah, sorry I should have been more specific - where is the properties folder?
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!
Fingers crossed for you - let me know if you succeed so I can try to duplicate!
No problem my friend, if I get it working when I get it working I'll give you a shout!
I like your optimism!
is working on a reply...