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='+arraylist
+' 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> <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.