Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    Apr 17, 2014 @ 05:58
    Craig100
    0

    Probably simple MVC questions

    With help, got a mailing form working in an MVC V6.1.5 site. Unfortunately I built it in a separate project referencing my Umb install in VS. So one solution two projects, one umb, one the mailing project. I now want to add to the mailing project but I can't  use normal razor like Model as it doesn't know anything about the umbraco site content. So I want to bring the mail project into the Umbraco site so that I can. It only consists of a couple of models and controllers. It's rendered using a partial view that is in the Umbraco site. My issue is, I don't understand how to bring the files in and get them to work. They have a different namespace. If I change it, it still doesn't work.

    When you add controllers and models to the umbraco installation, do you have to rebuild the site and therefore end up with a new dll in the bin folder? Or does it just run at runtime?

    I really struggle with this stuff as I'm not in it all the time, I dip in and out of lots of things, and I find that it's very easy to get lost with all the documentation and help not telling you what version it's good for.

    Any help to clarify this for me and other strugglers would be appreciated.

    Craig (taking the hit for those who won't ask dumb questions but still need the answers;))

  • Phillip Turner 98 posts 412 karma points
    Apr 28, 2014 @ 21:42
    Phillip Turner
    0

    Model and Controllers require you to rebuild the site unless they live the app_code directory directly, which in that case they are compiled at runtime.

    If your main umbraco project has a Controllers dir and a Models dir, you should just be able to copy the files in there and adjust the name spaces accordingly and add any additional references (if needed) to get it to work.

    I have done this successfully.

Please Sign in or register to post replies

Write your reply to:

Draft