Copied to clipboard

Flag this post as spam?

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


  • Arnel Gajek 5 posts 95 karma points
    Jun 14, 2019 @ 09:04
    Arnel Gajek
    0

    Create Umbraco Content with C#

    Hi,

    I'm working on a project where the customer can create different type of events that has an Id. This Id is later on used as an parentId to the end customers when they registrate to the event the user has created. The registration to each event is connected to an "invite" that has a parentId and it creates a content in the backoffice.

    Is there any way to make this Id dynamic, which makes it possible to have the same type of event for different years?

    And how could this be connected to the content that the end user creates?

    This is the code so far, the problem is that the parentId is hard coded which makes it hard to make it dynamic while creating the content for the end user.

  • Arnel Gajek 5 posts 95 karma points
    Jun 14, 2019 @ 12:04
    Arnel Gajek
    100

    Fixed the issue, used CurrentPage.Id to solve this one.

    So instead of using _contentService.GetById(XXX); I used CurrentPage.Id and the CMS will solve this one out for you.

Please Sign in or register to post replies

Write your reply to:

Draft