To access the text typed in the editor, we can use the
server side property Value.
protected void btnSave_Click(object sender, EventArgs
e)
{
Response.Write(rtfComments.Value);
}
Execute the page and you can see the FCKeditor appearing
the screen.
Customizing the FCKeditor
By default, when we execute the page we will get all the
toolbars for the FCKeditor. Refer below figure,
Most of the times, we will not require all the style
elements that is seen in the above figure that comes by default. The FCKeditor
by default will come with 2 different toolset, Default and Basic. The above
figure is default. Basic toolset will have very basic style elements like bold,
italics, lists and links. To set the Basic toolset, set the property ToolbarSet
to "Basic". You can see the output below.
In part 2, we will see more about creating our own
toolsets and more about customizing the FCKeditor. We will also see about
accessing the FCKeditor in client side and doing some basic validations on the
control.
Making ToolbarSet Non Collapsible
By default, the toolbar set is collapsible and it can be
controlled by the upward arrow button seen on the left hand side of the toolbar
set. Setting ToolbarCanCollapse to "false" will make the toolbar to always
appear and will remove the upward arrow.
Controlling Copying text from other sources
By default, when we copy text from other sources like
word, html page it will retain the html styles in copied text in the toolbar
area. To disable this behavior, we can use the Boolean property
ForcePasteAsPlainText. Setting this to true will remove the source formatting
and only copies the text.
|