Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3425824
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:38:25+00:00 2026-05-18T06:38:25+00:00

I have several <asp:TextBox TextMode=MultiLine> elements on a page. On load, I populate them

  • 0

I have several <asp:TextBox TextMode="MultiLine"> elements on a page. On load, I populate them (through the VB code behind), and then turn them into TinyMCE editors (through the jQuery TinyMCE plugin). Each text box also has a button associated with it, with the purpose of submitting the text back to the code behind for insertion into a database.

I discovered earlier that when the submit button is clicked, I have to “save” the contents of the editor to the text box, but that is not my problem. Even after I’ve done so, the edits are not showing up in the code behind.

As I’ve mentioned, I’m using jQuery. Here is my click handler. Keep in mind that all buttons are submit buttons in ASP.NET, hence the submit class:

$('input.submit').live('click', function() {
    tinyMCE.EditorManager.triggerSave();
});

So, when any submit button is clicked all tinyMCE editors have their save event triggered. After this is executed, I have checked the value of the textarea I’m looking for, (again, through JavaScript) and it seems to have the edits (I’m using Chrome’s Developer tools, and console.log):

console.log($(this).parent().find('textarea').val());

On the server side, though, I see none of the edits in the click handler for the submit button:

Dim paragraph As String = Me.myTextArea.Text
' Results in the original text, not the edited text

Other Notes:

  • Each editor is in its own update panel
  • Due to the nature of the content being submitted (HTML), I’ve had to set EnableEventValidation="false" and ValidateRequest="false" (this is an internal application, and this recommendation came from a more experienced developer)
  • I’m fairly new to .NET, but this behavior just seems ridiculous to me. I must be missing something critical.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:38:25+00:00Added an answer on May 18, 2026 at 6:38 am

    I’ve figured it out.

    It was exactly what I suggested in my comment on the original question. The ASP.NET async postback was firing, sending the old text to the server. Then my onclick was firing, saving the new text to the textarea, and hitting my breakpoint (allowing me to see that the new text was, in fact, saved to the text area). After that, the server processed the (old) text, hitting my breakpoint in the VB.

    It seems that ASP.NET gets top priority in any onclick that happens, at least when using asynchronous means. This means that any custom click handlers added through javascript will fire after the ASP.NET click.

    This makes some amount of sense, given how JS processes multiple click handlers – it’s a first-come-first-served sort of process.

    The solution, in my case, was to save the contents of the TinyMCE editor on change, rather than on the button click:

    $(this).tinymce({
        script_url : '../scripts/tiny_mce.js',
        theme: 'advanced',
        plugins: 'save',
        theme_advanced_buttons1 : 'bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,image,link,unlink,|,fontsizeselect,forecolorpicker',
        theme_advanced_buttons2 : '',
        theme_advanced_buttons3 : '',
        content_css : '../css/landingpage-tinymce.css',
        onchange_callback: function(ed) {
            ed.save();
        }
    });
    

    Note the onchange_callback which saves the contents of the editor to the textarea. This will save the contents any time the editor adds what they call an “undo level”, which means any time the users changes something and moves the cursor, or any time the editor blurs, among other events.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one of my ASP.NET pages I have several asp:textbox fields. On this page
I have several ASP.NET websites in a solution along with a common C# code
I use asp.net + MVC1.0 and in a web-page I have several forms, within
I have several elements in my web page generated by JavaScript. Here's an example
I have several ImageButtons on the top of my page, then I have a
I have a simple ASP.NET page where after the initial page load the user
I have several ASP:TextBox controls on a form (about 20). When the form loads,
I have several textareas like: <asp:textbox class=input ThisIsRussia ..... /> <asp:textbox class=input ..... />
I try several ways to create a few control in an .aspx page's code-behind.
I have several ASP.NET sites in IIS7 and would like to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.