The use of Ewebeditor

Source: Internet
Author: User


First, download and configure the Ewebeditor control

When the download is complete, unzip the compressed package, and then move anywhere in the directory (such as F:\news\edit\) where the arrival point is located. Here, save it to the Edit folder under the site news root directory.

This completes the download of the Ewebeditor control and its configuration. As you can see, the control is actually very convenient to use, and users simply release it to the site directory without having to make any settings on the IIS server.

Understanding the Ewebeditor control

The Ewebeditor control is an WYSIWYG online editor that can bind to a text field in the foreground or a hidden field form control, and implement data transfer and interaction between controls.

To implement Ewebeditor communication with form controls, the user must first understand the communication programming interface of the control. In simple terms, you need to know how to call the control in a Web page.

Call:

The Ewebeditor call is very simple and basically simply adds a line of code to the original use.

Standard Call statement:

<iframe id= "EWebEditor1" src= "/ewebeditor.htm?id=content1&style=standard" frameborder= "0" scrolling= "no" Width= "height=" >

</iframe>

As you can see, this is an IFRAME form control, which is also a floating frame that you would normally call. The control includes 6 parameters, which are described in one by one below, as shown in appendix Table I.

Appendix Table A description of related parameters


Parameter name


Description


Id


A form control used to identify an IFRAME floating frame on a Web page, thereby distinguishing its peers


Src


Used to invoke the Ewebeditor control. Where the user must replace "/ewebeditor.asp" with the actual path of the Ewebeditor control in the site. For example, when you save it to the following edit folder in the site news root directory, you


"/ewebeditor.asp" shall be changed to "edit/ewebeditor.asp" accordingly.


Note that there are two URL variables appended to "ewebeditor.asp" with the name "id" and "style" respectively.


Where the meaning of the variable is:


(1) ID: The name of the form control used for the associated save edits, that is, the form control name that is bound to the Ewebeditor control


(2) Style: The name of the type used, either a standard style name (standard) or a custom style name


Frameborder


Used to set the border of an IFRAME floating frame with a value of only 0 or 1.


When frameborder equals 0 o'clock, there is no border, and 1 o'clock is the border of the display frame


Scrolling


Lets you set whether a scroll bar appears in the IFrame floating frame. It has 3 values, namely no, auto, and yes. When frameborder


is equal to No, there is no scroll bar: When Yes, the scroll bar is represented. If it is auto, the floating box


A scroll bar appears when the height or length of the frame is less than the height or length of the object embedded inside the frame


Width


Used to set the width of the IFRAME floating frame


Height


Used to set the height of the IFRAME floating frame


Parameter description:

· /ewebeditor.asp should be changed to the path you actually installed

· Parameter ID: The associated table item name, which is the table item name to be referenced by the save page, and when multiple calls are guaranteed to be different, see the following example

· Parameter style: The name of the style used, either a standard style name or a custom style name, which can be left blank if the standard standard is used

· Width,height: According to the actual need to set, Ewebeditor will automatically adjust and adapt to its

· In background management, you get all the entry parameters for the best calling code for each style: (ie: ewebeditor.asp?)

Once you know the relevant parameter settings for the Ewebeditor control invocation, users can customize the style, appearance, and the form control of the online editor to their own needs.

The following will define the height, width, and style of the online editor as 350, 550, and standard, depending on the needs of the press release system, and it is bound to a hidden field called news. Then, depending on the parameter definition, its complete invocation statement is as follows:

<iframe id= "EWebEditor1" src= "Edit/ewebeditor.htm?id=news&style=standard" frameborder= "0" scrolling= "no" Width= "height=" >

</iframe>

third, create form controls and bind Ewebeditor controls

The Ewebeditor control is equivalent to a functional module that can be bound to form controls such as text fields and hidden fields. However, because the implementation of the two binding methods is consistent, the following will briefly describe the binding of the form control and the Ewededitor control with a "hidden field" as the calling form control.

(1), open the News add page (addnew.asp), and then insert a hidden field in the cell to the left of the news content and set its name to news.

(2), position the mouse focus on the right side of the hidden field, and then switch to Code view, and enter the following code fragment in the current location:

<iframe id= "EWebEditor1" src= "Edit/ewebeditor.htm?id=news&style=standard" frameborder= "0" scrolling= "no" Width= "height=" >

</iframe>

As you can see, the value of the URL parameter ID in the code snippet above is "news", which is the same as the name of the hidden field. This completes the binding of the form control to the Ewebeditor control.

iv. submission of form data

Switch to the server Behaviors Control Panel, click the + button, and then select Insert Record in the Drop-down menu. Finally, in the Insert Record dialog box that pops up, make the parameter settings.

You can see that the form control for the news content field is a hidden field named "News," and the other parameter settings remain unchanged. This eliminates the need for the user to consider the execution of the Ewebeditor control, and simply bind it to another form control.

v. Output of news content

       After the data is submitted to the background database, in the News Detail page (showdetail.asp), the user simply binds the field "content" to the appropriate location of the page. You do not need to set the news content to pass the Htmlcode () function before outputting to the page.

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.