2009-07-27 9 views

Répondre

2
using System; 

using System.Web; 
using AjaxControlToolkit.HTMLEditor; 

namespace MyCustomControls 
{ 
public class MyCustomEditor: Editor 
{ 
    protected override void FillBottomToolbar() 
    { 
     //Do not add any buttons in the bottom toolbar 
     //BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.DesignMode()); 
    } 
} 

}

2

Il y a probablement d'autres façons de le faire via le code, mais je suis paresseux et juste ajouté le CSS suivant:

.ajax__htmleditor_editor_bottomtoolbar { 
    display:none; 
} 
0
AjaxControlToolkit.HTMLEditor.Toolbar test = (AjaxControlToolkit.HTMLEditor.Toolbar)Editor1.Controls[0].Controls[2].Controls[0].Controls[0]; 

test.Buttons.ToList().ForEach(delegate(AjaxControlToolkit.HTMLEditor.ToolbarButton.CommonButton x) 
{ 
    x.Enabled = false; 
}); 
1

Par exemple, si vous voulez masquez l'élément de barre d'outils Pharagraph puis remplacez ce code

$create(AjaxControlToolkit.HTMLEditor.ToolbarButton.Paragraph, 
    {"activeModesIds":"0","activeSrc":this.get_imagesPath() 
    +"ed_format_paragraph_a.gif","downSrc":this.get_imagesPath() 
    +"ed_format_paragraph_a.gif","normalSrc":this.get_imagesPath()+"ed_format_paragraph_n.gif"}, 
    null, null, $get(id+"_ctl01_ctl35")); 

dans AjaxControlToolkit.HTMLEditor.ClientSideEditor.js avec ce

$create(AjaxControlToolkit.HTMLEditor.ToolbarButton.Paragraph, null, null, null, $get(id+"_ctl01_ctl35")); 
Questions connexes