Mano
Mano

Reputation: 445

Html editor for asp.net c# website

How to add a HTML editor, to add images, format and for adding videos to the message that I am going to send. Is there any free tool that I can use. And How should I store the images and videos in the database. Consider user is uploading the images and video from his computer.

Upvotes: 2

Views: 3254

Answers (2)

AVIK GHOSH
AVIK GHOSH

Reputation: 117

At first take a class name CustomEditor.cs

using AjaxControlToolkit.HTMLEditor;
namespace MyControls
{
    public class CustomEditor : Editor
    {
        protected override void FillTopToolbar()
        {
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Bold());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Italic());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.BackColorSelector());
            AjaxControlToolkit.HTMLEditor.ToolbarButton.FontName fontName = new AjaxControlToolkit.HTMLEditor.ToolbarButton.FontName();
            TopToolbar.Buttons.Add(fontName);
            options = fontName.Options;
            option = new AjaxControlToolkit.HTMLEditor.ToolbarButton.SelectOption();
            option.Value = "arial,helvetica,sans-serif";
            option.Text = "Arial";
            options.Add(option);
            AjaxControlToolkit.HTMLEditor.ToolbarButton.FontSize fontSize = new AjaxControlToolkit.HTMLEditor.ToolbarButton.FontSize();
            TopToolbar.Buttons.Add(fontSize);
            options = fontSize.Options;
            option = new AjaxControlToolkit.HTMLEditor.ToolbarButton.SelectOption();
            option.Value = "8pt";
            option.Text = "1 ( 8 pt)";
            options.Add(option);
           }
        protected override void FillBottomToolbar()
        {
            BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.DesignMode());
        }
        public AjaxControlToolkit.HTMLEditor.ToolbarButton.SelectOption option { get; set; }
        public System.Collections.ObjectModel.Collection<AjaxControlToolkit.HTMLEditor.ToolbarButton.SelectOption> options { get; set; }
    }
}

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
<%@ Register namespace="MyControls" tagprefix="custom" %> <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager> <custom:CustomEditor ID="CustomEditor1" 
        Width="450px"  
        Height="200px"
        runat="server" />

Upvotes: 1

Pradip R.
Pradip R.

Reputation: 450

http://ckeditor.com/

Get it From here. i have used this. Read instruction for further information. There will be a dll and a fckeditor like folder that you should add in your project. and then jst add reference to your page as you do for any ascx control. then just put tag prefix an tag name similarly.. :)

Upvotes: 1

Related Questions