Copied to clipboard

Flag this post as spam?

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


  • Raja 21 posts 90 karma points notactivated
    Apr 12, 2016 @ 08:55
    Raja
    0

    Get The Values from Database

    Hi, I am new to Umbraco. My requirement is, I have to list Categories and its product list(each product will have its own page) from .Net MVC Solution to Umbraco page(both in same solution).

    simple way, how to take values from external sql db and show it in Umbraco. I have gone through many links but couldn't find clear explanation. good if I get some sample code/project.

  • Jinesh Kaneriya 22 posts 155 karma points
    Apr 12, 2016 @ 09:38
    Jinesh Kaneriya
    0

    Hi Raja,

    Umbraco works like normal MVC way see the code. I have prodmanager class that contain static method that return products based on category as data table and it also display hoe to render it to cshtml.

                @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
                @{                 
                     var product = ProdManager.GetProducts("xyz"); 
                    // .cs file contain ProdManager class with GetProducts static method that return data table or list.
    }
    <h1>
    Product Name : @custBought.Rows[0]["PROD_NAME]
    Price : @custBought.Rows[0]["PROD_PRICE"]
    <h1>
    

    For understanding how to create umbraco pages and cms stuffs you can visit here.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft