1: Custom Ftb toolbar:
autogeneratetoolbarsfromstring = "false"
toolbars/Ftb: toolbar/Ftb: toolbarbutton cannot have an id. VS is a good thing,
example:
2: Call the script
Scriptblock = "This. Ftb. inserthtml ('freetextbox is great !! ');"
It can be written in <Ftb: toolbarbutton
It can be placed in a class.
Public class uploadimg: toolbarbutton
{
Public uploadimg (): Base ("uploadimg", "ftb_uploadimg", "insertimage ")
{}
}
3: Call Ftb functions externally
Ftb_api [ftbid]. inserthtml (texttoinsert );
4: Call functions on the local page on other pages
A: Passing Parameters
Home page: scriptblock = "This. Ftb. inserthtml (window. showmodaldialog ('xx. aspx? Id = XXX '));"
Subwindow: window. returnvalue = xxx; window. Close ();
B: directly provide function calls
Home page: Provides externally callable JS Functions
Subwindow: opener. Top. insert2ftbtext ('',''); window. Close (); // call
5: Chinese imagegallery
Protected override void render (htmltextwriter writer)
{
Writer. Write (this. chinesegallery ());
}
/// <Summary>
/// Get the control, hand-to-hand
/// </Summary>
/// <Returns> </returns>
Private string chinesegallery ()
{
Stringwriter writer = new stringwriter (); // provides a Writable Text area.
Htmltextwriter buffer = new htmltextwriter (writer); // you can obtain the content in this region by letting htmlwriter operate on this region.
Base. Render (buffer); // first draw the page, let's get the initial Page html Code
String html = writer. tostring (); // locate this code and process it to convert English into Chinese characters.
//
Html = html. Replace ("there are no images:", "no image yet ");
Html = html. Replace ("Upload File", "Upload image ");
Html = html. Replace ("status </div>", "status </div> ");
Html = html. Replace ("selected image", "selected image ");
Html = html. Replace ("create folder", "create directory ");
Html = html. Replace ("delete image", "delete this image ");
Html = html. Replace ("\" Upload \ "", "'upload '");
Html = html. Replace ("<legend> preview", "<legend> preview image ");
Html = html. Replace ("<legend> dimensions", "<legend> set display size ");
Html = html. Replace ("original size", "source image size ");
Html = html. Replace ("Custom size", "set ");
Html = html. Replace ("lock image ratio", "lock size ratio ");
Html = html. Replace ("percentage", "percentage ");
Html = html. Replace ("image gallery", "my photo album ");
Html = html. Replace ("<legend> Properties", "<legend> image attributes ");
Html = html. Replace ("align", "horizontal arrangement ");
Html = html. Replace ("border", "border ");
Html = html. Replace ("vspace", "left margin ");
Html = html. Replace ("hspace", "Top margin ");
Html = html. Replace ("Alt", "convert text ");
Html = html. Replace ("title", "image title ");
Html = html. Replace ("value = \" insert \ "", "value = 'insert into editor '");
//
Return HTML;
}