Muhammad Hernanda
Muhammad Hernanda

Reputation: 23

CKEditor has Empty Value on asp:textbox

I have implemented CKEditor on my Visual Studio 2013 and it has been showed clearly with asp:TextBox element.

But somehow while I fetch the value it returns empty.

This is my code:

<div class="row">
  <div class="col-md-11">
    <asp:TextBox ID="bodyMessageTextBox" runat="server"/>
    <script type="text/javascript">
      CKEDITOR.replace("ctl00_ContentPlaceHolder1_bodyMessageTextBox");
    </script>
  </div>
</div>

I fetch with this method;

_msemailsetup.BodyMessage = this.bodyMessageTextBox.Text;

Can someone help me solve this?

Upvotes: 2

Views: 714

Answers (1)

Laxman Gite
Laxman Gite

Reputation: 2318

You will get the data with below code :

Inspect (press f12 on browser) the browser and then check the name of editor

 var editorText = CKEDITOR.instances.bodyMessageTextBox.getData();
 _msemailsetup.BodyMessage = editorText ;

Upvotes: 3

Related Questions