Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Jul 13, 2016 @ 10:40
    Biagio Paruolo
    0

    Umbraco DocType and Model to use in a custom controller. How to get the doctype class and save doctype?

    Hi, How to get the doctype class to use in a custom controller and then "create" a content type node?

    Now, I'm using this code:

    var newcustomer = Services.ContentService.CreateContent(model.Cognome, parentid, "Cliente", 0);
    
            newcustomer.SetValue("nome", model.Nome);
            newcustomer.SetValue("cognome", model.Cognome);
            newcustomer.SetValue("codiceFiscale", model.CodiceFiscale);
            newcustomer.SetValue("dataDiNascita", model.DataNascita);
            newcustomer.SetValue("luogoDiNascita", model.LuogoNascita);
    
  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Jul 13, 2016 @ 12:11
    Dave Woestenborghs
    0

    Hi Biagio,

    What do you mean with "doctype class". A strongly typed object representing your content ?

    Dave

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Jul 13, 2016 @ 14:25
    Biagio Paruolo
    0

    I create a Document type into Umbraco backend. So I wish to access to it from a surface controller.

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Jul 13, 2016 @ 16:36
    Dave Woestenborghs
    0

    Hi Biago,

    For creating content there are no models. The way you are doing it is correct.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft