I want to add a button to the sitecore page editor ribbon and I want it to work as a link. For example, when I click this button, the page should be redirected to HOMEURL/sample.aspx.
I have written a class, that inherits from Command.
public class addlink : Command
{
public override void Execute(CommandContext context)
{
Sitecore.Web.WebUtil.Redirect("/sample.aspx");
}
}
Then, for this webedit ribbon element in core db, I gave as the click event webedit:addlink. The onclick event of this link on the browser is javascript:return scForm.invoke('webedit:addlink', event).
So, the redirect does not happen. How can I add a link to the page editor ribbon? I would appreciate any suggestions to improve my class or other approaches are also welcome.
Thanx