I want to create a macro programmatically, I can use macro.xslt or macro.scripting file to create a xslt or script macro, but how can i create a macro using a .net control programmatically?
Hi, markus, thanks for your reply, I have searched some keywords, but still not get the proper result, can you give me some proposals for the search keywords?
create a marco programmatically
I want to create a macro programmatically, I can use macro.xslt or macro.scripting file to create a xslt or script macro, but how can i create a macro using a .net control programmatically?
Macro macro = Macro.MakeNew(name);
macro.Xslt= controlUrl;
macro.Save();
Have a look at the Umbraco soure-code, search for the iAction to create a new macro of the type you want. That should contain some useful inspiration.
EDIT: I was talking about the ITaskReturnUrl-interface. The IAction-interface are used to create actions in the "right click menu" aka context menu.
Hi, markus, thanks for your reply, I have searched some keywords, but still not get the proper result, can you give me some proposals for the search keywords?
Your welcome!
Have a look at: /umbraco/presentation/umbraco/create/macroTasks.cs and DLRScriptingTasks.cs in the same folder.
:D
The problem has been solved, just use "marco.Type = controlUrl"
is working on a reply...