Copied to clipboard

Flag this post as spam?

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


  • Osman Coskun 170 posts 404 karma points
    Dec 05, 2019 @ 11:53
    Osman Coskun
    0

    Generate vCard From Content Node

    Hello,

    I want to generate downloadable vCard generated from information in staff profile content. I found https://dzone.com/articles/creating-vcard-in-aspnet-core that defines the process.

    I'm not a .Net ninja and couldn't find how to apply similar code using surface controllers in Umbraco.

    Can anyone guide me?

    Thanks in advance...

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Dec 15, 2019 @ 23:27
    Alex Skrypnyk
    0

    Hi Osman

    Did you solve this issue? Can you share with our community how did you solve it/

    Thanks,

    Alex

  • Osman Coskun 170 posts 404 karma points
    Dec 16, 2019 @ 09:49
    Osman Coskun
    0

    Hi, Unfortunately i couldn't find how to use the sample code :(

  • Graham Davis 110 posts 376 karma points
    Dec 17, 2019 @ 03:26
    Graham Davis
    0

    Are you using Visual Studio for your development? The code has to be modified slightly since Umbraco does not use .NET Core. Rewrite vCardActionResult as a controller so it can be called when a web page is loaded or called via ajax. Don't use Task and async. Throw out what they have done and use these steps in the controller instead:

    1. Declare the class

      vCard card = new vCard();

    2.Load the values

     card.FirstName = [your first name];
        card.LastName = [your last name];
    
    ...remaining fields …
    

    3 return the vCard from the controller:

    return card.ToString(); 
    

    note: you may also have to define a route to use the controller

Please Sign in or register to post replies

Write your reply to:

Draft