简体   繁体   中英

Cannot display Tiny MCE Editor inside update panel C#

I cannot display my tiny MCE editor inside update panel.

I have two update panel using update mode "conditional" In the first I added button on click of it display MCE editor which is inside second update panel I did this from my code behind, on click event I updated both panels

UpdatePanel1.Update();
UpdatePanel2.Update();

div.Style.Add("display", "block");//this is inside second update pane

Its simple text Area rather than MCE editor itself..

You have to call the initializing method of the TinyMCE whenever the update panel is refreshed.

For this, you have either to call this method (tinyMCE.init) from a RegisterStartupScript method,

      protected void Page_Load(object sender, System.EventArgs e)
      {                
          ScriptManager.RegisterStartupScript(this.Page, 
              this.Page.GetType(), mce.ClientID, "callInt" + mce.ClientID + "();",  true);
       }

OR to create a page load javascript function in the head section of the page like this:

     function pageLoad() 
     {
         tinyMCE.init();
      }


      <body onload="pageLoad()">  
      </body> 

Hope this helps..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM