Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 00:05
    Connie DeCinko
    0

    Where is Umbraco.Web.Mvc?

    I am trying to create a surface controller that my jQuery grid can use to get it's data. All the examples say to reference Umbraco.Web.Mvc yet I do not find this dll anywhere on my system. Where is it? How do I build my project without this reference?

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 19, 2015 @ 06:51
    Jan Skovgaard
    0

    Hi Connie

    You need to include a reference to the cms.dll in your project in order to be able to inherit from Umbraco.Web.Mvc.

    Hope this helps.

    /Jan

  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 16:07
    Connie DeCinko
    0

    Thanks Jan, I'll give it a try. But I wonder if I'm chasing something that cannot be done.

    I created a new Intranet site just over a year ago with Umbraco 6.1.4. It's set to in the umbracoSettings.config. My master template uses Razor for layout. I have several, what I call, mini-apps in the site, pages that display entries in non-Umbraco tables or admin various Intranet applications that are unrelated to Umbraco. Some of these mini-apps are iframed .aspx pages, some of them are .NET userControls, some of the simpler ones are Razor views while the really old ones are iFramed ColdFusion pages.

    I need to update/upgrade the older iFramed pages and integrate them into my Umbraco Intranet site. I really want to some day have everything running MVC, the site in general and any mini-apps within the site. I have no problem creating partial views and assigning them to an Umbraco macro, then drop the macro into a page. One such page is a jQuery datagrid that gets its data via an AJAX call to a .NET webservice. I would like to change this so the data comes from a call to a controller.

    I know I can create a SurfaceController to get the routing to work, but I haven't figured out yet if this is going to work if the Intranet site is running in WebForms mode instead of MVC mode.

    Thoughts?

  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 16:12
    Connie DeCinko
    0

    Back to my original question...

    I have this line in my class... public class OpinionsSurfaceController : Umbraco.Web.Mvc.SurfaceController

    and VS is telling me I'm missing the correct using, it cannot find the Umbraco name space. I added the reference to cms.dll but no change. Do I need cms.dll as well as something else? Do I need all the Umbraco dlls in my references?

  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 17:25
    Connie DeCinko
    1

    Found it. Need to reference umbraco.dll

    Also, just for grins, changed the umbracoConfig to Mvc and my site still works. But I cannot seem to use my controller as it throws a 404 error when my AJAX call tries to hit it.

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 19, 2015 @ 18:04
    Jan Skovgaard
    0

    Hi Connie

    Aaah, sorry! I just double checked the solution where I checked this earlier today...turns out I messed it up. It was actually the umbraco.dll that I was browsing...not the cms.dll...

    My bad - But you managed to figure it out anyway :)

    /Jan

  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 18:15
    Connie DeCinko
    0

    Now if I can just figure out why I get a 404 error trying to contact my controller.

    I tried various versions of...

    "sAjaxSource": "/umbraco/surface/OpinionsSurfaceController/getOpinions",
    
    "sAjaxSource": "/umbraco/surface/Opinions/getOpinions",
    
    "sAjaxSource": "/Opinions/getOpinions",
    

    all give a 404.

  • Connie DeCinko 931 posts 1159 karma points
    Feb 19, 2015 @ 19:58
    Connie DeCinko
    1

    Hallelujah! I finally got it to work. Just had to keep trying different variations. I proved I can integrate an MVC mini app in my existing Umbraco installation.

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 20, 2015 @ 08:36
    Jan Skovgaard
    0

    Hi Connie

    Sounds good - Do you mind sharing how you got it to work? Others might benefit :)

    /Jan

  • Connie DeCinko 931 posts 1159 karma points
    Feb 23, 2015 @ 23:15
    Connie DeCinko
    0

    Well, I seem to have run into a snag. I am now trying to add a form to my partial view. Seems I cannot specify the model to go with that form. I need to specify it in the view that calls the partial. Is there a way to do this? perhaps via a property on the macro or ???

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies