Enabling/Disabling TinyMCE from View/Server side and Setting Content back into DIV
My Question is,
I have simplified my question more. How to use below code in server side or in view. Is there any workaround like @Html.IsAdmin than mceAddControl should call otherwise mceRemoveControl.
function toggleEditor(id)
{
if (!tinyMCE.get(id)) {
tinyMCE.execCommand('mceAddControl', false, id);
}
else {
tinyMCE.execCommand('mceRemoveControl', false, id);
}
}
Second Question is, In below case I have TextArea
<textarea id="contentDiv" rows="15" cols="100" style="width:100%">@Model.Page.Html</textarea>
I have saved HTML in DB from above TinyMCE TextArea like b开发者_C百科elow in DB
tinyMCE.get('contentDiv').getContent()
How I set DB HTML content back into TextArea. I want this in View/Server side without using JavaScript
Like I saved
Testing
Testing
in DB saved
Testing<br />
Testing
but when I set the content back in TextArea I see Testing
Testing with HTML Tags.I hope you understand my Question
精彩评论