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?
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.
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?
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.
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 :)
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.
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 ???
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?
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
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?
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?
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.
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
Now if I can just figure out why I get a 404 error trying to contact my controller.
I tried various versions of...
all give a 404.
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.
Hi Connie
Sounds good - Do you mind sharing how you got it to work? Others might benefit :)
/Jan
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 ???
is working on a reply...