in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Get the commandname of customtoolbar in aspxhtmleditor in serverside

Last post 10/29/2008 1:46 AM by Sreejith A. 2 replies.
Page 1 of 1 (3 items)
Sort Posts:
Previous Next
  • 10/28/2008 12:26 AM

    Get the commandname of customtoolbar in aspxhtmleditor in serverside

    I put an aspxhtmleditor in asp page.Add 2 custom toolbar for insert image and audio file in editor.I put 2 command names for the custom bar.I need the command name of these toolbar in the serverside.How i get the command name if the toolbar dynamically.Please help me i ned it uegently.

  • 10/28/2008 10:10 AM In reply to

    Re: Get the commandname of customtoolbar in aspxhtmleditor in serverside

    Hi!

    To obtain a command name of a toolbar item, use the following code:

    ASPxHtmlEditor1.Toolbars[toolbarIndex].Items[itemIndex].CommandName

    Thanks,
    Andrew R

    R&D, ASP.Net Team
    Developer Express Inc.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/Support/Center
  • 10/29/2008 1:46 AM In reply to

    Re: Get the commandname of customtoolbar in aspxhtmleditor in serverside

    Thanks for your kind reply friends.I got the commandname in server side.But how can i check the selected toolbar is a particuler one so ther i want to transfer data from server side to client side.Means i have 2 toolbars for uploading images  and audios.If i click image toolbar the image upload code will be executed.otherwise audio upload code will be executed.

     

    The code will be send below.

     

    In the server side this is the code executed:string insertImageCommandName= htmlEditorMail.Toolbars[2].Items[0].CommandName;
                string insertAudioCommandName = htmlEditorMail.Toolbars[2].Items[1].CommandName;
                if (insertImageCommandName=="pastetemplate")
                {
                    GetImages();
                }
                if (insertAudioCommandName == "pasteAudioTemplate")
                {
                    GetAudioFiles();
                }

     

    In the client side i call the image and audio upload using the code:

    <script type="text/javascript">
        var CommandNameValue=null;
        function PasteEmailTemplate(commandName)
         {
            displayFloatingDiv(divGal.id, "My Window", 600, 400, 347, 232)
            document.getElementById('hdGatValue').value=commandName;
            CommandNameValue=commandName;
           // divGal.style.visibility = "visible";
         }
       function Copy()
       {
            var commandName=CommandNameValue;
           var imgSource=document.getElementById("ctl00_ContentPlaceHolder1_hidImgSource").value;//Get the Images selected from the serverside.
             var arraylist=imgSource.split('~');//Put the image into an arraylist.
             var imageDisplayTag="<table><tr>";
             for(var i = 0; i < arraylist.length; i++)
             {
             imageDisplayTag +='<td><img src='+arraylistIdea+' width="50px" height="50px"></img></td>';//Display the images stored in the arrylist using an image tag.
             }
            imageDisplayTag+="</tr></table>"
            var audioSource=document.getElementById("ctl00_ContentPlaceHolder1_hidAudioSource");
           
            switch(commandName)
            {
                case('pastetemplate'):
                    //var imageDisplayTag='<img src='+src+' width="50px" height="50px"></img>&nbsp;<a href="http://www.61.17.230.144/BAM/'+src+'">View High Resolution Image</a>';
                    HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.SELECT_ALL, null);
                    HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.PASTEHTML_COMMAND, imageDisplayTag);
                    break;
                case('pasteAudioTemplate'):
                    HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.SELECT_ALL, null);
                    HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.PASTEHTML_COMMAND, audioSource.value);
                    break;
            }
            hiddenFloatingDiv("divGal")
            divGal.style.visibility = "hidden";
       }
        </script>

    Please help me i need it urgently.

Page 1 of 1 (3 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED