diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/razor index 0efbf1e5c5..2979d6865d 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/razor +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/razor @@ -11,7 +11,9 @@ // To select the current paragraph in document container.documentEditor.selection.selectParagraph(); - // To get the selected content as sfdt - var selectedContent = container.documentEditor.selection.sfdt; + // To get the selected content as text + var selectedContentText = container.documentEditor.selection.text; + // To get the selected content as SFDT (rich text) + var selectedContentSFDT = container.documentEditor.selection.sfdt; } \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/tagHelper index 5e87f95a83..9cf6c5e9f1 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-paragraph/tagHelper @@ -13,7 +13,9 @@ // To select the current paragraph in document container.documentEditor.selection.selectParagraph(); - // To get the selected content as sfdt - var selectedContent = container.documentEditor.selection.sfdt; + // To get the selected content as text + var selectedContentText = container.documentEditor.selection.text; + // To get the selected content as SFDT (rich text) + var selectedContentSFDT = container.documentEditor.selection.sfdt; } \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/razor index 98f75c0595..69a7a6ea6d 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/razor +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/razor @@ -12,6 +12,8 @@ container.documentEditor.selection.selectCurrentWord(); // To get the selected content as text - var selectedContent = container.documentEditor.selection.text; + var selectedContentText = container.documentEditor.selection.text; + // To get the selected content as SFDT (rich text) + var selectedContentSFDT = container.documentEditor.selection.sfdt; } \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/tagHelper index 7569edbf72..59352fa775 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/get-word/tagHelper @@ -14,6 +14,8 @@ container.documentEditor.selection.selectCurrentWord(); // To get the selected content as text - var selectedContent = container.documentEditor.selection.text; + var selectedContentText = container.documentEditor.selection.text; + // To get the selected content as SFDT (rich text) + var selectedContentSFDT = container.documentEditor.selection.sfdt; } \ No newline at end of file diff --git a/ej2-asp-core-mvc/document-editor/how-to/get-current-word.md b/ej2-asp-core-mvc/document-editor/how-to/get-current-word.md index 3a7c3fe742..36ffa42310 100644 --- a/ej2-asp-core-mvc/document-editor/how-to/get-current-word.md +++ b/ej2-asp-core-mvc/document-editor/how-to/get-current-word.md @@ -1,6 +1,6 @@ --- layout: post -title: Select and retrieve current word and Paragraph in ##Platform_Name## Document Editor Component +title: Get current Word/Para in ##Platform_Name## Document editor control | Syncfusion description: Learn how to select and retrieve current word and Paragraph from the Syncfusion ##Platform_Name## Document Editor Component platform: ej2-asp-core-mvc control: Get The Current Word And Paragrapgh @@ -25,7 +25,9 @@ The following example code illustrates how to select and get the current word as {% include code-snippet/document-editor-container/get-word/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Get-word.cs" %} -{% endhighlight %}{% endtabs %} +{% endhighlight %} +{% code-snippet/document-editor-container/get-word/document-editor.cs %} +{% endtabs %} {% elsif page.publishingplatform == "aspnet-mvc" %} @@ -34,12 +36,12 @@ The following example code illustrates how to select and get the current word as {% include code-snippet/document-editor-container/get-word/razor %} {% endhighlight %} {% highlight c# tabtitle="Get-word.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-word/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% endif %} -To get the bookmark content as SFDT (rich text), check this [`link`](../../document-editor/how-to/get-the-selected-content/#get-the-selected-content-as-sfdt-rich-text) - ## Select and get the paragraph in current cursor position You can use [`selectParagraph`] API in selection module to select the current paragraph at cursor position and use [`text`] API or [`sfdt`] API to get the selected content as plain text or SFDT from Document Editor component. @@ -53,7 +55,9 @@ The following example code illustrates how to select and get the current paragra {% include code-snippet/document-editor-container/get-paragraph/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Get-paragraph.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-paragraph/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% elsif page.publishingplatform == "aspnet-mvc" %} @@ -62,5 +66,7 @@ The following example code illustrates how to select and get the current paragra {% include code-snippet/document-editor-container/get-paragraph/razor %} {% endhighlight %} {% highlight c# tabtitle="Get-paragraph.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-paragraph/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% endif %} diff --git a/ej2-asp-core-mvc/document-editor/how-to/get-the-selected-content.md b/ej2-asp-core-mvc/document-editor/how-to/get-the-selected-content.md index c822f07a24..c45d931f0f 100644 --- a/ej2-asp-core-mvc/document-editor/how-to/get-the-selected-content.md +++ b/ej2-asp-core-mvc/document-editor/how-to/get-the-selected-content.md @@ -1,6 +1,6 @@ --- layout: post -title: Get The Selected Content in ##Platform_Name## Document Editor Component +title: Get Selected Content in ##Platform_Name## Document Editor Component | Syncfusion description: Learn here all about get the selected content in Syncfusion ##Platform_Name## Document Editor component of Syncfusion Essential JS 2 and more. platform: ej2-asp-core-mvc control: Get The Selected Content @@ -24,7 +24,9 @@ You can use `text` API to get the selected content as plain text from React Docu {% include code-snippet/document-editor-container/get-text/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Get-text.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-text/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% elsif page.publishingplatform == "aspnet-mvc" %} @@ -33,7 +35,9 @@ You can use `text` API to get the selected content as plain text from React Docu {% include code-snippet/document-editor-container/get-text/razor %} {% endhighlight %} {% highlight c# tabtitle="Get-text.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-text/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% endif %} @@ -46,7 +50,7 @@ You can add the following custom options using this API, ## Get the selected content as SFDT (rich text) -You can use `sfdt` API to get the selected content as plain text from React Document Editor component. +You can use `sfdt` API to get the selected content as rich text from React Document Editor component. {% if page.publishingplatform == "aspnet-core" %} @@ -55,7 +59,9 @@ You can use `sfdt` API to get the selected content as plain text from React Docu {% include code-snippet/document-editor-container/get-sfdt/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Get-sfdt.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-sfdt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% elsif page.publishingplatform == "aspnet-mvc" %} @@ -64,7 +70,9 @@ You can use `sfdt` API to get the selected content as plain text from React Docu {% include code-snippet/document-editor-container/get-sfdt/razor %} {% endhighlight %} {% highlight c# tabtitle="Get-sfdt.cs" %} -{% endhighlight %}{% endtabs %} +{% code-snippet/document-editor-container/get-sfdt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} {% endif %} @@ -72,5 +80,5 @@ You can use `sfdt` API to get the selected content as plain text from React Docu You can add the following custom options using this API, * Save or export the selected content as SFDT file. -* Get the content of a bookmark in Word document as SFDT by selecting a bookmark using `selectbookmark` API. +* Get the content of a bookmark in Word document as SFDT by selecting a bookmark using `select bookmark` API. * Create template content that can be inserted to multiple documents in cursor position using `paste` API. \ No newline at end of file