Copied to clipboard

Flag this post as spam?

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


  • christopher muya 18 posts 200 karma points
    Nov 03, 2019 @ 18:29
    christopher muya
    1

    How to display data in a macro partial view from a custom table in the umbraco database.

    How can I access/read from a cshtml file the data I have in a custom table in the umbraco database. I would like to display the data in a macro partial view. Umbraco 8.2.0 Thank you

  • Marcio Goularte 388 posts 1360 karma points
    Nov 03, 2019 @ 21:47
    Marcio Goularte
    0

    why macro? need the cache? can use partial view and child actions and get data from database https://our.umbraco.com/documentation/reference/templating/mvc/child-actions

    If you need cache, use outputcache or dunotcaching

  • christopher muya 18 posts 200 karma points
    Nov 03, 2019 @ 22:23
    christopher muya
    0

    It's going to be part of a plugin. The view will be inside the App_plugins folder.

  • Marcio Goularte 388 posts 1360 karma points
    Nov 04, 2019 @ 00:09
    Marcio Goularte
    0

    sample

    [ChildActionOnly]
    public ActionResult MyActionName()
     {           
           return PartialView("~/App_Plugins/MyFolder/MyFile.cshtml");
      }
    
  • christopher muya 18 posts 200 karma points
    Nov 07, 2019 @ 13:32
    christopher muya
    0

    To be more specific, how do i access the Umbraco database? What calls do i need to make?

Please Sign in or register to post replies

Write your reply to:

Draft