Custom freetextbox; custom imagegallery

Source: Internet
Author: User

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;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.