.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

AJAX HTML Editor insertHTML() function

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :ASP.Net


I have editor and I want to add a HTML to it with a button from a toolbar. I have been searching through this forum and came up with this, but it does not work:

Here is the code on the .aspx page:

<script type="text/javascript">
        function addHTML() {
            var editor = $find("editor");
            var editPanel = editor.get_editPanel();
            var designPanel = editPanel.get_activePanel();

    <customEditors:MyHtmlEditor ID="editor" runat="server"></customEditors:MyHtmlEditor>

And this is a class for my custom editor:

Public Class MyHtmlEditor
        Inherits Editor

        Protected Overrides Sub FillTopToolbar()

            Dim newBtn As New AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton
            newBtn.Attributes.Add("onmouseover", "addHTML();")

View Complete Post

More Related Resource Links

Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

Ajax HTML Editor and Timers

Howdy, I have a extended htmleditor in a mainpage and I have a seperate timer in a control that is on the master page to notify the user of messages. Everytime the timer fires, after text has been entered into the htmleditor, focus is automatically pulled to the htmleditor.    If I disable the timer control there is no issue. I have tried wrapping both the timer, with an updatepanel as well as the htmleditor and the other textboxes on the page with updatepanel, here is the updatepanel below. I have even tried the autofocus to false on the htmleditor.  I am using ajax 3.5 and IE8. Anyone got any suggestions? <asp:UpdatePanel ID="uppnlContent" runat="server" UpdateMode="Conditional" RenderMode="Inline"> <ContentTemplate>  

How to use AJAX editor with HTML content?


I have a AJAX editor and I want to put the HTML content in a database and I want to get the HTML data from the database to put in the HTML editor, in HTML mode.

So I do:

Editor1.ActiveMode = AjaxControlToolkit.HTMLEditor.ActiveModeType.Html;
        Editor1.Content = MessageLabel2;

Editor1.ActiveMode = AjaxControlToolkit.HTMLEditor.ActiveModeType.Html;

Editor1.Content = data_from_database;

But what happens is that I get the HTML data from the database in designmode in the editor, so I have HTML in designmode and HTML to HTML in HTMLmode (and that is not what I want of course).

Of course I want only HTML in HTML mode and in designmode I want the normal text.

How can you do this and is this possible?

Ajax html editor spell checker


I am using ajax html editor, is it possible to embed a spell checker?

Thanks for the helpful info.




Hello I would like to ask how to submit a new post to tadabase table using HTML Editor? 

The subject will be a normal text box but the body is content of Editor how to declare it??

And one more thing how will looks a code if you want to use a HttpUtility.HtmlEncode(something.Trim()),?

At a moment im using the code like this :

 MembershipUser currentUser = Membership.GetUser();
        Guid currentUserId = (Guid)currentUser.ProviderUserKey;
        // Insert a new record into GuestbookComments
        string connectionString = ConfigurationManager.ConnectionStrings["SecurityTutorialsConnectionString"

Cutting Edge: Go Beyond HTML Forms With AJAX


This month we examine forms in the context of AJAX applications and look at various approaches to implementing features such as auto-saving, just-in-time validation, and submission throttling.

Dino Esposito

MSDN Magazine June 2009

Editor's Note: Get Ready for AJAX


If you're fortunate enough to attend a developer conference this year, look around at the variety of people. There are all kinds out there, a diverse ecosystem as the marketing folks might say. Even within a relatively narrow group like programmers, you'll find a wide range of goals and interests.

MSDN Magazine July 2006

ASP.NET HTML Editor - Upload images

The article ASP.NET HTML Editor - Upload images was added by adarshtated on Tuesday, June 29, 2010.

In this article we are seen how to create a custom HTML Editor control to add image button in it.Create A Class-----------CustomEditor.cs------------------Add Name Spaceusing AjaxControlToolkit.HTMLEditor;namespace MyControls{ public class CustomEditor



I'm looking into using the HTMLEditor from the toolkit. I know its open source which isn't the problem. The problem is that I don't want to have my program to be open source but would like to use the editor. The source code I'd like to be paid for where the compiled version (the dlls and aspx pages) will be free to download. Is it possible to do that?

How to send parameters to the AJAX callback function


I need to send som parameters to the callback function of my AJAX call, how can i do that:



function DoSomething(id, textbox1)
  AjaxHandler.FindSomethingInDB(id, Callback);

function Callback(result, eventArgs)
  // Here i need to know the value of textbox1 from the function "DoSomething"


Html editor word wrap problem

I created an html editor which uses an iframe for designing. The iframe doesnt wraps the text within it.... but the text keeps on extending in the same row towards the right. i tried setting scrolling='no' but it didnt work... tried word-wrap:break-word but thats also of no use........ please help! 

Can i override the sqlexcption object into ajax OnError function?

Hi Dude, I am little stranger to web service. i do not know how can i implement your given functionality? i will show my webservice and web method. Please let me know how can i override the sqlexption error object to ajax error object? Please help me as soon as possible.. <WebMethod()> _       Public Function AddDetailPageData(ByVal strTableQuery As String, ByVal strFieldName As String, ByVal strFieldData As String, ByVal strWherCond As String)        Dim intRecCount As Integer = 0        Try            Dim param() As SqlParameter = New SqlParameter() _                                {New SqlParameter("@strtableQuery", SqlDbType.NVarChar, 50), _                                New SqlParameter("@strFieldList", SqlDbType.NVarChar, 4000), _                           

package 'Visual Web Developer HTML Source Editor Package' has failed to load

Hi All  I am using VS 2008 Team Edition with SP1 installed. All was fine till yesterday when i started receiving the error 'package 'Visual Web Developer HTML SourceEditor Package' has failed to load properly (GUID={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}' . I am able to build the project and can do work in cs files but no support for the design view. Reinstall is not fixing this, Please HELP

How do I turn off HTML validation in the Content Editor Web Part?

I'm fairly used to SharePoint 2007, where I could inject pretty much whatever I wanted into the CEWP, and among other things affect the page style or create div-based layouts. However, in SharePoint 2010, inserting code into the CEWP seems to go through a HTML validation process, which inserts and converts the original HTML code and ends up in incorrect results. How can I turn off this HTML validation stuff, or alternatively, is there any other way for me to inject HTML into a web part as I wish?

Editing HTML Editor Font Family

How to remove the Font Family selection in the HTML editor.  We want to limit to 3 fonts. Thanks

Asp.net MVC: How to call javascript function in Html.ActionLink

When I edit single recored in page, I use checkbox to get a selected row not every row with an actionlink element, but it seemed I cant make this way happen through calling javascript code(function GetSelectedRow() should return an id). Could anyone have a nice idea?<head runat="server"> <title>Index</title> <script type="text/javascript" language="javascript"> function GetSelectedRow() { var a = 0; var chkBoxes = document.getElementsByName("chkSelect"); var count = chkBoxes.length; for (var i = 0; i < count; i++) { if (chkBoxes[i].checked == true) a = chkBoxes[i].primaryKeyID; } return a; } </script> </head> <body> <div> <span style="width:20%"> <%: Html.ActionLink("Add", "Create")%> </span> <span> <%: Html.ActionLink("Edit", "Edit", new { id = GetSelectedRow()) %> </span> <span> <%: Html.ActionLink("Detial", "Details", new { id = GetSelectedRow() })%> </span> <span> <%: Html.ActionLink("Delete", "Delete", new { i

HTML Editor: Change Edit Panel Background Color

I've created a custom editor from the default AJAX HTMLEditor control to limit the toolbar buttons, etc. But I can't see how to set the background color of the text area in design mode. I'd like to set the background color to something other than white, because with my app most users will want to use white as their text color. White text on a white background is no bueno. The editor has ForeColor and BackColor properties, but these values don't control the text area. I tried creating custom css styles based on Editor.css, but all I end up with is an HTMLEditor without a border. Am I approaching this wrong? Any suggestions?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend