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
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:
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
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
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
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
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
Hi Richard,
Very nice to hear from you and thanks for the reply.
I will definitely check this out.
Best regards,
Steve
is working on a reply...