Applying style to textbox

2 posts, 1 answers
  1. sumither
    sumither avatar
    13 posts
    Member since:
    Apr 2011

    Posted 26 Apr 2011 Link to this post

    How to set the cssclass attribute while inserting the textbox control in radeditor..?
  2. Answer
    Rumen avatar
    14317 posts

    Posted 26 Apr 2011 Link to this post

    Hello Sumither,

    You can use the OnClientPasteHtml event of RadEditor to apply a className to the inserted textbox element, e.g.

    <script type="text/javascript">
        function OnClientPasteHtml(sender, args) {
            var commandName = args.get_commandName();
            var value = args.get_value();
            if (commandName == "InsertFormElement") {
                if (value.match("<input")) {
                    value = value.replace("<input", "<input className='myClass' ");
    <telerik:RadEditor runat="server" OnClientPasteHtml="OnClientPasteHtml" ID="RadEditor1"></telerik:RadEditor>

    All the best,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top