2009-07-27 49 views

回答

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

很可能有其他的方式通過代碼來做到這一點,但我懶惰,只是增加了以下CSS:

.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

例如,如果你想隱藏Pharagraph工具欄項目,然後替換此代碼

$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")); 

in AjaxControlToolkit.HTMLEditor.ClientSideEditor.js 和這個

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