Hi irshad1231,
Check this example. Now please take its reference and correct your code.
HTML
<script src="https://cdn.ckeditor.com/4.16.1/standard-all/ckeditor.js"></script>
<asp:TextBox ID="editor1" runat="server" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<script>
CKEDITOR.replace('editor1', {
extraPlugins: 'embed,autoembed,image2',
height: 500,
// Load the default contents.css file plus customizations for this sample.
contentsCss: [
'https://cdn.ckeditor.com/4.16.1/full-all/contents.css',
'https://ckeditor.com/docs/ckeditor4/4.16.1/examples/assets/css/widgetstyles.css'
],
// Setup content provider. See https://ckeditor.com/docs/ckeditor4/latest/features/media_embed
embed_provider: '//ckeditor.iframe.ly/api/oembed?url={url}&callback={callback}',
// Configure the Enhanced Image plugin to use classes instead of styles and to disable the
// resizer (because image size is controlled by widget styles or the image takes maximum
// 100% of the editor width).
image2_alignClasses: ['image-align-left', 'image-align-center', 'image-align-right'],
image2_disableResizer: true
});
</script>
Code
C#
protected void Button1_Click(object sender, EventArgs e)
{
string CkEditorText = editor1.Text;
// Insert code.
}
VB.Net
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim CkEditorText As String = editor1.Text
End Sub
Note: Set ValidateRequest="false" inpage level and add requestValidationMode in web config.
<httpRuntime requestValidationMode="2.0" />
Refer below article.