Introduction:
In this example Iam Going to Explain how to use ajax Html editor extender example in asp.net.Description: The HtmlEditorExtender is an ASP.NET AJAX Control that enables you to extend the standard ASP.NET TextBox control with support for rich formatting. For example, the HtmlEditorExtender enables users to apply bold, italic, underline, subscript, superscript, and different foreground and background color to text.
When Ever You Want to Use Ajax Controls in your website First you need Add AjaxControlToolkit reference to your application
<%@ Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="asp"
%>
You can Change TagPrefix Also,Some Exaples tagPrefix="ajax", tagPrefix="cc1",tagPrefix="asp" and also
And also you have to add Tool kit Scriptmanager Control under <Form> tag:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
Aspx Page coding :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:TextBox runat="server" ID="TextBoxCommitment" TextMode="MultiLine"
Columns="50"
Rows="10" Width="98%" BackColor="White" />
<asp:HtmlEditorExtender ID="HtmlEditorExtender1" TargetControlID="TextBoxCommitment"
DisplaySourceTab="true" runat="server">
<Toolbar>
<asp:Undo />
<asp:Redo />
<asp:Bold />
<asp:Italic />
<asp:Underline />
<asp:StrikeThrough />
<asp:Subscript />
<asp:Superscript />
<asp:JustifyLeft />
<asp:JustifyCenter />
<asp:JustifyRight />
<asp:JustifyFull />
<asp:InsertOrderedList />
<asp:InsertUnorderedList />
<asp:CreateLink />
<asp:UnLink />
<asp:RemoveFormat />
<asp:SelectAll />
<asp:UnSelect />
<asp:Delete />
<asp:Cut />
<asp:Copy />
<asp:Paste />
<asp:BackgroundColorSelector />
<asp:ForeColorSelector />
<asp:FontNameSelector />
<asp:FontSizeSelector />
<asp:Indent />
<asp:Outdent />
<asp:InsertHorizontalRule />
<asp:HorizontalSeparator />
<asp:InsertImage />
</Toolbar>
</asp:HtmlEditorExtender>
</div>
</form>
</body>
</html>
|
1 comment:
thanx
Post a Comment