How get value from WYSIWYG Editor into string variable using asp.net c#?
Loading
How get value from WYSIWYG Editor into string variable using asp.net c#?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Jul 26, 2023, 10:28 PM EDT
Hi khadar mohammad try the below example:
C#
using System; using System.Web.UI; public partial class MyPage : Page { protected void SubmitButton_Click(object sender, EventArgs e) { // Get the content from the editor string content = editorTextBox.Text; // Now you can use the 'content' variable as needed. // For example, you can store it in a database or process it further. // For demonstration purposes, let's show an alert with the content: ClientScript.RegisterStartupScript(GetType(), "ShowContent", $"alert('{content}');", true); } }Refer this:
https://www.c-sharpcorner.com/article/asp-net-mvc5-rich-text-wysiwyg-editor/
Mohammad HussainRank #513 · 4.8K reputationPosted Jul 27, 2023, 4:18 AM EDT
tinymce.init({ selector: "#EditorTextarea", height: 300 }); // Function to get the content from TinyMCE and store it in the hidden field function getContentFromEditor() { var editorContent = tinymce.get("EditorTextarea").getContent(); document.getElementById('').value = editorContent; } Get Contentprotected void SaveContentButton_Click(object sender, EventArgs e) { // Access the content from the hidden field string editorContent = EditorContentHiddenField.Value; // Process the editorContent further as needed // ... }