Copied to clipboard

Flag this post as spam?

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


  • Steve 140 posts 321 karma points
    Nov 25, 2019 @ 22:48
    Steve
    0

    How best to run 'utility' type code in Umbraco v8?

    Hi!
    In a v7 site I have a series of tasks such as exporting data from nodes within the site to an excel file. The code is C# written as an .ascx user control run as a macro placed on a dedicated 'utility' page. Browse to the page, the code executes and a file download begins...
    Can anyone provide suggestions on how best to create this functionality in Umbraco 8?
    I just discovered this afternoon that user controls have been dropped with the new version.
    No output to the screen is really required in this case so seems odd to be doing this within a Macro Partial View. I'm sure there's another way but not sure where to start!
    Thanks for your help!
    Steve

  • Paul Sterling 718 posts 1534 karma points MVP 8x admin c-trib
    Nov 25, 2019 @ 23:44
    Paul Sterling
    0

    Hi Steve -

    Perhaps consider using something like Hangfire.io? We use it (with both v7 and v8) for scheduled tasks but I believe you can also create jobs "on demand."

    Here's a great v8 tutorial by Umbraco HQ'r Sebastiann Janssen:

    https://cultiv.nl/blog/using-hangfire-for-scheduled-tasks-in-umbraco/

    -Paul

  • Steve 140 posts 321 karma points
    Nov 26, 2019 @ 00:09
    Steve
    0

    Hi Paul,
    Thanks for the suggestion.
    I did come across Hangfire.io in the search for a solution but haven't yet pursued it because I'd prefer something native to Umbraco and one which would minimize the modification of the code and process we've developed over the past 5 years or so. Ugh! There's a lot to it.
    Upon your recommendation, I'm going to take another look at Hangfire.io and see how it works. Will keep you posted!
    Thanks, Steve

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Nov 26, 2019 @ 07:53
    Richard Soeteman
    100

    Hi Steve,

    Out Of the box UmbracoV8 comes with a BackgroundTaskRunner that you can use for this. It's even well documented. Find the docs here

    Hope this helps,

    Richard

  • Steve 140 posts 321 karma points
    Nov 27, 2019 @ 01:16
    Steve
    0

    Hi Richard,
    Very nice to hear from you and thanks for the reply.
    I will definitely check this out.
    Best regards,
    Steve

Please Sign in or register to post replies

Write your reply to:

Draft