How to make TinyMCE work inside an UpdatePanel?

前端 未结 12 923
别跟我提以往
别跟我提以往 2021-02-07 13:28

I\'m trying to do something that many people seem to have been able to do but which I am unable to implement any solution. The TinyMCE control works pretty well in an asp.net fo

12条回答
  •  逝去的感伤
    2021-02-07 13:54

    i solved this problem as call tiny mce after the response generation of the ajax call

    function edittemp(name) {
    
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null)
    {
    alert ("Your browser does not support XMLHTTP!");
    return;
    }
    
    
    var url="edit_temp.php";
    url=url+"?id="+name;
    
    
    
    
    
    xmlhttp.onreadystatechange=stateChanged3;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null); 
    
    
    }
    function stateChanged3()
    {
    if (xmlhttp.readyState==4)
    {
    spl_txt=xmlhttp.responseText.split("~~~");
    
    
    document.getElementById("edit_message").innerHTML=spl_txt[0];   
    tinyMCE.init({
    theme : "advanced",
    mode: "exact",
    elements : "elm1",
    theme_advanced_toolbar_location : "top",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,"
    + "justifyleft,justifycenter,justifyright,justifyfull,formatselect,"
    + "bullist,numlist,outdent,indent",
    theme_advanced_buttons2 : "link,unlink,anchor,image,separator,"
    +"undo,redo,cleanup,code,separator,sub,sup,charmap",
    theme_advanced_buttons3 : "",
    height:"350px",
    width:"600px"
    });
    }
    }
    

    and the page caaled by ajax call is

    
    
    
    editing using tiny_mce
    
    
    
    

    change the template here


    may be helpful in such situation.

提交回复
热议问题