Thanks for sharing the Hybrid Framework it has helped my understanding of MVC in the context of Umbraco.
One thing I am struggling with is how to populate a model that is then passed down to a form. The reason I need to do this is that I have a number of drop down lists on a form that need populated from collections.
You can see how I have my controller set up at the URL below:
The problem that I having is that the page (http://.../my-action) never executes the code for the ActionResult MyAction. Instead the DefaultController is executed. This is where I am stuck.
Instead of doing a Html.Partial you should do a Html.Action. That goes to a controller where you can add the dropdownlist data and than return the partial view. The best practises has an Html.Action example for the donut caching on the contact page, but you can also use that for the form. The donut cache part can be disabled.
Best Practice for Populating DropDownLists
Thanks for sharing the Hybrid Framework it has helped my understanding of MVC in the context of Umbraco.
One thing I am struggling with is how to populate a model that is then passed down to a form. The reason I need to do this is that I have a number of drop down lists on a form that need populated from collections.
You can see how I have my controller set up at the URL below:
http://pastebin.com/9jYQ1iqp
The problem that I having is that the page (http://.../my-action) never executes the code for the ActionResult MyAction. Instead the DefaultController is executed. This is where I am stuck.
The code for my view is:
http://pastebin.com/5y7yGCpZ
I woudl really appreciate a little help, please.
Hello,
Instead of doing a Html.Partial you should do a Html.Action. That goes to a controller where you can add the dropdownlist data and than return the partial view. The best practises has an Html.Action example for the donut caching on the contact page, but you can also use that for the form. The donut cache part can be disabled.
Jeroen
Hello,
Did you found a solution by trying Html.Action?
Jeroen
Hi Jeroen, the Hthml.Action worked perfrectly, thanks for the help.
is working on a reply...