Posted by : Anwar Hossain
Category : How to use ajax toolkit in asp.net C#

How to use html editor Ajax control toolkit example in c#

Dear viewers I will show how to use Ajax toolkit html Editor. Normally Editor Content is saved to the database and display this result using label or literal control. But in this case firstly I have taken an Editor then fixed this height and width 400 and 250 respectably. A button Control has been taken to submit the content of the Editor and a label control has been used to display the content of the Editor.

Ajax toolkit html editor in asp.net c#

HTML

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
  TagPrefix="cc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>Ajax Editor Example</title>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <table width="100%" cellpadding="0" cellspacing="0">
  <tr>
  <td width="130">
  <b>Enter your Content</b>
  </td>
  <td width="5">
  :
  </td>
  <td>
  <cc1:Editor ID="Editor1" runat="server" Height="250px" Width="400px" />
  </td>
  </tr>
  <tr>
  <td>
  </td>
  <td>
  </td>
  <td height="20">
  </td>
  </tr>
  <tr>
   <td>
  &nbsp;
  </td>
  <td>
  &nbsp;
  </td>
  <td>
  &nbsp;
  </td>
  </tr>
  <tr>
  <td>
  </td>
  <td>
  </td>
  <td>
  <asp:Button ID="btnSubmit" runat="server" Text="submit" OnClick="btnSubmit_Click" />
  </td>
   </tr>
  <tr>
  <td>
  &nbsp;
  </td>
  <td>
  &nbsp;
  </td>
  <td>
  &nbsp;
  </td>
  </tr>
  <tr>
  <td>
  &nbsp;
  </td>
  <td>
  &nbsp;
  </td>
  <td>
  <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
  </td>
  </tr>
  </table>
  </div>
  <asp:ScriptManager ID="ScriptManager1" runat="server">
  </asp:ScriptManager>
  </form>
</body>
</html>
 

CODE BEHIND

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class TestDesign_AjaxEditorExample : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
 
  }
  protected void btnSubmit_Click(object sender, EventArgs e)
  {
  lblResult.Text = Editor1.Content.Trim();
  Editor1.Content = string.Empty;
  }
 
}

Out Put

ajax-toolkit-htmlEditor

Output

ajax-toolkit-htmlEditor_-result



Realted Article Headline

How to use TextBoxWatermarkExtender in asp.net using c#
How to use Ajax AutoCompleteExtender control in asp.net using c#
How to use Ajax Collapsible panel control in asp.net c#
How to use ASP.Net AJAX Control Toolkit ModalPopupExtender Control in asp.net c#
how to add an Ajax Control Toolkit Accordion to a page
How to use html editor Ajax control toolkit example in c#
How to use Ajax ConfirmButtonExtender in asp.net using c#
how to use ajax calendar extender in asp net c#
How to use ajax toolkit FilteredTextBox Control in c#

Article Category

How to create asp.net control dynamically
Learn HTML for beginner
DataList example in C Sharp
Mail sending in asp.net c#
State Management in ASP C #
Basic sql tutorial for Beginner
DataTable example in ASP.Net C#
How to use LINQ in ASP.NET C#
asp.net c # basic tutorial
How to use ajax toolkit in asp.net C#
How to use different types of validation control using asp.net c#
How to use grid view in asp.net c#
Protected by Copyscape Online Plagiarism Detection