Unionblitz
asked on
.NET AJAX With TinyMCE
RichTextWidget.ascx:
I have a user control that contains a label with a textbox and some hidden fields inside of it. I have an AddEvent() javascript function that runs whenever the page finishes loading.
JScript.js:
Inside of the AddEvent() javascript function, I am calling the tinyMCE stuff, which takes care initializing and hiding the textbox, etc.
I also have a add_endRequest(), which is linked to the same tinyMCE initializing piece. So, when the UpdatePanel is updating, it should reinit the TinyMCE controls.
Testing.aspx:
I have this user control (RichTextWidget.ascx) inside of an UpdatePanel. When I press the submit button, everything is working fine, except for one huge thing...
The problem: The User's text is not being remembered on the code behind during the async postback! I figure this is because the textfield isn't being updated correctly by tinyMCE.
How do I get the UpdatePanel to recognize changes being done in the tinyMCE?
This idea didn't work:
Sys.WebForms.PageRequestMa nager.getI nstance(). add_endReq uest(funct ion(){
var newContent = GetMCEEditorFromArray('<%= this.ClientID %>_rte_tmce').getContent() ;
$access('<%= this.ClientID %>_rte_tmce').value = newContent; // set the hidden text field to the new value
});
Ideas???
I have a user control that contains a label with a textbox and some hidden fields inside of it. I have an AddEvent() javascript function that runs whenever the page finishes loading.
JScript.js:
Inside of the AddEvent() javascript function, I am calling the tinyMCE stuff, which takes care initializing and hiding the textbox, etc.
I also have a add_endRequest(), which is linked to the same tinyMCE initializing piece. So, when the UpdatePanel is updating, it should reinit the TinyMCE controls.
Testing.aspx:
I have this user control (RichTextWidget.ascx) inside of an UpdatePanel. When I press the submit button, everything is working fine, except for one huge thing...
The problem: The User's text is not being remembered on the code behind during the async postback! I figure this is because the textfield isn't being updated correctly by tinyMCE.
How do I get the UpdatePanel to recognize changes being done in the tinyMCE?
This idea didn't work:
Sys.WebForms.PageRequestMa
var newContent = GetMCEEditorFromArray('<%=
$access('<%= this.ClientID %>_rte_tmce').value = newContent; // set the hidden text field to the new value
});
Ideas???
ASKER
That solution does not work in my situation.
HERE IS WHAT I AM ABLE TO DO:
1. When the page loads, javascript initializes tinyMCE for specific textareas (which are in User Controls).
2. The user enters data into the IFrame (TinyMCE's interface).
3. User presses button:
a. If it's not inside an update panel, the server-side code acknowledges the data you enter/change in the IFrame.
b. If it's inside an update panel, the server-side code only acknowledges the original text (the text set in the textarea).
Oddly, if I press submit several times with an updatepanel, the second or third time around, the user text (from several submissions ago) finally gets put into the textarea/iframe.
Ideas?
HERE IS WHAT I AM ABLE TO DO:
1. When the page loads, javascript initializes tinyMCE for specific textareas (which are in User Controls).
2. The user enters data into the IFrame (TinyMCE's interface).
3. User presses button:
a. If it's not inside an update panel, the server-side code acknowledges the data you enter/change in the IFrame.
b. If it's inside an update panel, the server-side code only acknowledges the original text (the text set in the textarea).
Oddly, if I press submit several times with an updatepanel, the second or third time around, the user text (from several submissions ago) finally gets put into the textarea/iframe.
Ideas?
Do you might to post some of the working code to see if anything can be modified based on requested?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Unionblitz,
I'm glad to hear it resolved. Thanks for sharing your final solution.
I'm glad to hear it resolved. Thanks for sharing your final solution.
This thread can give you the insight of the required solution:
http://stackoverflow.com/questions/547327/how-to-make-tinymce-work-inside-an-updatepanel